The system provides services to create files, move data into and out of files, and describe restrictions and structures of the file system. Many of these subroutines are the base for the system commands that have similar names. You can, however, use these subroutines to write new commands or utilities to help in the program development process, or to include in an application program.
The system provides subroutines for:
access, accessx, or faccessx | Determine accessibility of a file |
fclear | Clears space in a file |
fcntl, dup, or dup2 | Control open file descriptors |
fsync | Writes changes in a file to permanent storage |
getenv | Returns the value of an environment variable |
getutent, getutid, getutline, putuline, setutent, endutent, or utmpname | |
Access utmp file entries | |
getutid_r, getutline_r, pututline_r, setutent_r, endutent_r, or utmpname_r | |
Access utmp file entries | |
lseek or llseek | Move the read-write pointer in an open file |
lockfx, lockf, or flock | Controls open file descriptor locks |
mknod or mkfifo | Create regular, FIFO, or special files |
mktemp or mkstemp | Construct a unique file name |
open, openx, or creat | Return a file descriptor and creates files |
pclose | Closes an open pipe |
pipe | Creates an interprocess channel |
popen | Initiates a pipe to a process |
pathconf, fpathconf | Retrieve file implementation characteristics |
putenv | Sets an environment variable |
read, readx, readv, readvx | Read from a file or device |
rename | Renames directory or file within a file system |
statx, stat, fstatx, fstat, fullstat, fullstat | |
Get file status | |
tmpfile | Creates a temporary file |
tmpnam or tempnam | Construct a name for a temporary file |
truncate, ftruncate | Make a file shorter |
umask | Gets and sets the value of the file creation mask |
utimes or utime | Set file access or modification time |
write, writex, writev, writevx | Write to a file or device |
chdir | Changes the current working directory |
chroot | Changes the effective root directory |
getwd, getcwd | Get the current directory path name |
glob | Generates a list of path names to accessible files |
globfree | Frees all memory associated with the pglob parameter |
link | Creates additional directory entry for an existing file |
mkdir | Creates a directory |
opendir, readdir, telldir, seekdir, rewinddir, closedir | |
Performs operations on directories | |
readdir_r | Reads a directory |
rmdir | Removes a directory |
scandir, alphasort | Scan a directory |
readlink | Reads the volume of a symbolic link |
remove | Makes a file inaccessible by specified name |
symlink | Creates a symbolic link to a file |
unlink | Removes a directory entry |
confstr | Determines the current value of a specified system variable defined by a string |
fscntl | Manipulates file system control operations |
getfsent, getfsspec, getfsfile, getfstype, setfsent, or endfsent | |
Get information about a file system | |
getfsent_r, getfsspec_r, getfsfile_r, getfstype_r, setfsent_r, or endfsent_r | |
Get information about a file system | |
getvfsent, getvfsbytype, getvfsbyname, getvfsbyflag, setvfsent, endvfsent | |
Get information about virtual file system entries | |
mnctl | Returns mount status information |
quotactl | Manipulates disk quotas |
statfs, fstatfs | Get the status of a file's file system |
sysconf | Reports current value of system limits or options |
sync | Updates all file systems information to disk |
umask | Gets and sets the value of the file creation mask |
vmount | Mounts a file system |
umount, uvmount | Remove a virtual file system from the file tree |