2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
24 * File: FileUtil.h $XConsortium: FileUtil.h /main/4 1995/10/26 15:21:50 rswiston $
27 * (c) Copyright 1988, Hewlett-Packard Company, all rights reserved.
29 * (c) Copyright 1993, 1994 Hewlett-Packard Company *
30 * (c) Copyright 1993, 1994 International Business Machines Corp. *
31 * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
32 * (c) Copyright 1993, 1994 Novell, Inc. *
38 extern int _DtCreateDirs( char *path,
43 * Function Name: _DtCreateDirs
47 * This function is passed a directory path to create and the mode
48 * for the directory. It will create any of the parent directories
49 * on the path that do not already exist.
51 * This function may fail if any of the directories on the path already
52 * exist and are not writable. If some component of the path already
53 * exists and is not a directory, a failure will be returned.
55 * If some component of the path exists as a directory but does not have
56 * the specified mode, this will NOT cause a failure to be returned.
57 * This implies that if this function is called to create a writeable
58 * directory, it is possible for the function to return successfully
59 * but the directory may not actually be writable.
63 * status = _DtCreateDirs (path, mode);
65 * int status; Returns 0 on success and -1 on failure.
66 * char *path; The directory path to create.
67 * int mode; The file mode for setting any directories
73 extern int _DtIsOpenableDir( char *path) ;
77 * Function Name: _DtIsOpenableDir
81 * This function takes a path as an argument and determines whether
82 * the path is a directory that can be opened. This function returns
83 * "1" if the path is an openable directory and "0" if it is not.
85 * The path can be in the Softbench "context" form of "host:/path/dir".
89 * status = _DtIsOpenableDir (cpath)
91 * int status; Returns 1 for openable directories,
93 * char *cpath; The directory name to test.
99 _DtIsOpenableDirContext(
105 * Function Name: _DtIsOpenableDirContext
109 * This function takes a path as an argument and determines whether
110 * the path is a directory that can be opened. This function returns
111 * "1" if the path is an openable directory and "0" if it is not.
112 * In addition, if the calling function passes in another pointer,
113 * we will return the internal representation for the path.
115 * The path can be in the Softbench "context" form of "host:/path/dir".
119 * status = _DtIsOpenableDirContext (cpath, ret_ptr)
121 * int status; Returns 1 for openable directories,
123 * char *cpath; The directory name to test.
124 * char ** ret_ptr; Where to place internal format.
129 extern char * _DtReaddirLstat(
132 struct stat *st_buf) ;
136 * Function Name: _DtReaddirLstat
140 * This function reads the next entry out of a directory that has
141 * been opened with opendir and returns lstat information on it.
142 * For more information on reading a directory, see directory(3C).
143 * For more information on lstat information, see stat(2).
145 * This function returns a pointer to the full pathname of the directory
146 * entry. This memory is owned by this function and must not be
147 * freed. If the caller wants to keep the filename, it must make its
148 * own copy. When the end of the directory is encountered, NULL is
153 * dir_entry = _DtReaddirLstat (dir_name, dirp, st_buf);
155 * char *dir_entry; The name of the current entry within the
158 * char *dir_name; The full path name of the directory.
160 * DIR *dirp; A pointer to the directory [obtained from
163 * struct stat *st_buf; The lstat(2) information.
167 #endif /* _FileUtil_h */
169 /* DON'T ADD ANYTHING AFTER THIS #endif */