2 * File: FileUtil.h $XConsortium: FileUtil.h /main/4 1995/10/26 15:21:50 rswiston $
5 * (c) Copyright 1988, Hewlett-Packard Company, all rights reserved.
7 * (c) Copyright 1993, 1994 Hewlett-Packard Company *
8 * (c) Copyright 1993, 1994 International Business Machines Corp. *
9 * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
10 * (c) Copyright 1993, 1994 Novell, Inc. *
16 extern int _DtCreateDirs( char *path,
21 * Function Name: _DtCreateDirs
25 * This function is passed a directory path to create and the mode
26 * for the directory. It will create any of the parent directories
27 * on the path that do not already exist.
29 * This function may fail if any of the directories on the path already
30 * exist and are not writable. If some component of the path already
31 * exists and is not a directory, a failure will be returned.
33 * If some component of the path exists as a directory but does not have
34 * the specified mode, this will NOT cause a failure to be returned.
35 * This implies that if this function is called to create a writeable
36 * directory, it is possible for the function to return successfully
37 * but the directory may not actually be writable.
41 * status = _DtCreateDirs (path, mode);
43 * int status; Returns 0 on success and -1 on failure.
44 * char *path; The directory path to create.
45 * int mode; The file mode for setting any directories
51 extern int _DtIsOpenableDir( char *path) ;
55 * Function Name: _DtIsOpenableDir
59 * This function takes a path as an argument and determines whether
60 * the path is a directory that can be opened. This function returns
61 * "1" if the path is an openable directory and "0" if it is not.
63 * The path can be in the Softbench "context" form of "host:/path/dir".
67 * status = _DtIsOpenableDir (cpath)
69 * int status; Returns 1 for openable directories,
71 * char *cpath; The directory name to test.
77 _DtIsOpenableDirContext(
83 * Function Name: _DtIsOpenableDirContext
87 * This function takes a path as an argument and determines whether
88 * the path is a directory that can be opened. This function returns
89 * "1" if the path is an openable directory and "0" if it is not.
90 * In addition, if the calling function passes in another pointer,
91 * we will return the internal representation for the path.
93 * The path can be in the Softbench "context" form of "host:/path/dir".
97 * status = _DtIsOpenableDirContext (cpath, ret_ptr)
99 * int status; Returns 1 for openable directories,
101 * char *cpath; The directory name to test.
102 * char ** ret_ptr; Where to place internal format.
107 extern char * _DtReaddirLstat(
110 struct stat *st_buf) ;
114 * Function Name: _DtReaddirLstat
118 * This function reads the next entry out of a directory that has
119 * been opened with opendir and returns lstat information on it.
120 * For more information on reading a directory, see directory(3C).
121 * For more information on lstat information, see stat(2).
123 * This function returns a pointer to the full pathname of the directory
124 * entry. This memory is owned by this function and must not be
125 * freed. If the caller wants to keep the filename, it must make its
126 * own copy. When the end of the directory is encountered, NULL is
131 * dir_entry = _DtReaddirLstat (dir_name, dirp, st_buf);
133 * char *dir_entry; The name of the current entry within the
136 * char *dir_name; The full path name of the directory.
138 * DIR *dirp; A pointer to the directory [obtained from
141 * struct stat *st_buf; The lstat(2) information.
145 #endif /* _FileUtil_h */
147 /* DON'T ADD ANYTHING AFTER THIS #endif */