CONTENT="Modular DocBook HTML Stylesheet Version 1.64
7.4. Posix operations on files and directories
openDirStream dir calls opendir to obtain a directory stream for dir.
readDirStream dp calls readdir to obtain the next directory entry (struct dirent) for the open directory stream dp, and returns the d_name member of that structure.
The operation may fail with:
rewindDirStream dp calls rewinddir to reposition the directory stream dp at the beginning of the directory.
closeDirStream dp calls closedir to close the directory stream dp.
getWorkingDirectory calls getcwd to obtain the name of the current working directory.
changeWorkingDirectory dir calls chdir to change the current working directory to dir.
openFd path acc mode (OpenFileFlags app excl noctty nonblock trunc) calls open to obtain a Fd for the file path with access mode acc. If mode is Just m, the O_CREAT flag is set and the file's permissions will be based on m if it does not already exist; otherwise, the O_CREAT flag is not set. The arguments app, excl, noctty, nonblock, and trunc control whether or not the flags O_APPEND, O_EXCL, O_NOCTTY, O_NONBLOCK, and O_TRUNC are set, respectively.
createFile path mode calls creat to obtain a Fd for file path, which will be created with permissions based on mode if it does not already exist.
setFileCreationMask mode calls umask to set the process's file creation mask to mode. The previous file creation mask is returned.
createLink old new calls link to create a new path, new, linked to an existing file, old.
createDirectory dir mode calls mkdir to create a new directory, dir, with permissions based on mode.
createNamedPipe fifo mode calls mkfifo to create a new named pipe, fifo, with permissions based on mode.
removeLink path calls unlink to remove the link named path.
removeDirectory dir calls rmdir to remove the directory named dir.
rename old new calls rename to rename a file or directory from old to new.
getFileStatus path calls stat to get the FileStatus information for the file path.
getFdStatus fd calls fstat to get the FileStatus information for the file associated with Fd fd.
queryAccess path r w x calls access to test the access permissions for file path. The three arguments, r, w, and x control whether or not access is called with R_OK, W_OK, and X_OK respectively.
queryFile path calls access with F_OK to test for the existence for file path.
setFileMode path mode calls chmod to set the permission bits associated with file path to mode.
setOwnerAndGroup path uid gid calls chown to set the UserID and GroupID associated with file path to uid and gid, respectively.
setFileTimes path atime mtime calls utime to set the access and modification times associated with file path to atime and mtime, respectively.
touchFile path calls utime to set the access and modification times associated with file path to the current time.
getPathVar var path calls pathconf to obtain the dynamic value of the requested configurable file limit or option associated with file or directory path. For defined file limits, getPathVar returns the associated value. For defined file options, the result of getPathVar is undefined, but not failure. The operation may fail with:
getFdVar var fd calls fpathconf to obtain the dynamic value of the requested configurable file limit or option associated with the file or directory attached to the open channel fd. For defined file limits, getFdVar returns the associated value. For defined file options, the result of getFdVar is undefined, but not failure.
The operation may fail with: