The chdir function may be used to changed the current working
directory to the directory specified by dir. Upon sucess it
returns zero; however, upon failure it returns -1 and sets
errno accordingly.
The chmod function changes the permissions of file to those
specified by mode. It returns 0 upon success, or
-1 upon failure setting errno accordingly.
See the system specific documentation for the C library
function chmod for a discussion of the mode parameter.
The chown function is used to change the user-id and group-id of
file to uid and gid, respectively. It returns
zero upon success and -1 upon failure, with errno
set accordingly.
Notes
On most systems, only the super user can change the ownership of a
file.
The getcwd function returns the absolute pathname of the
current working directory. If an error occurs or it cannot
determine the working directory, it returns NULL and sets
errno accordingly.
Notes
Under Unix, OS/2, and MSDOS, the pathname returned by this function
includes the trailing slash character. Some versions also include
the drive specifier.
The listdir function returns the directory listing of all the
files in the specified directory dir as an array of strings.
It does not return the special files ".." and "." as
part of the list.
The lstat_file function behaves identically to stat_file
but if file is a symbolic link, lstat_file returns
information about the link itself, and not the file that it
references.
See the documentation for stat_file for more information.
Notes
On systems that do not support symbolic links, there is no
difference between this function and the stat_file function.
The mkdir function creates a directory whose name is specified
by the dir parameter with permissions specified by mode.
Upon success mkdir returns zero, or it returns -1 and
sets errno accordingly. In particular, if the directory
already exists, the function will fail and set errno to
EEXIST.
The mode parameter may not be meaningful on all systems. On
systems where it is meaningful, the actual permissions on the newly
created directory are modified by the process's umask.
The rename function renames a file from old to new
moving it between directories if necessary. This function may fail
if the directories do not refer to the same file system. It returns
0 upon success, or -1 upon error and sets errno accordingly.
The stat_file function returns information about file
through the use of the system stat call. If the stat call
fails, the function returns NULL and sets errno accordingly.
If it is successful, it returns a stat structure with the following
integer fields: