access(判断是否具有存取文件的权限)
#include <unistd.h> int access(const char *pathname, int mode);
alphasort(依字母顺序排序目录结构)
#include <dirent.h> int alphasort(const struct dirent **a, const struct dirent **b);
chdir(改变当前的工作目录)
#include <unistd.h> int chdir(const char *path);
chmod(改变文件的权限)
#include <sys/stat.h> int chmod(const char *pathname, mode_t mode);
chown(改变文件的所有者)
#include <unistd.h> int chown(const char *pathname, uid_t owner, gid_t group);
chroot(改变根目录)
#include <unistd.h> int chroot(const char *path);
closedir(关闭目录)
#include <sys/types.h> #include <dirent.h> int closedir(DIR *dirp);
fchdir(改变当前的工作目录)
#include <unistd.h> int fchdir(int fd);
fchmod(改变文件的权限)
#include <sys/stat.h> int fchmod(int fd, mode_t mode);
fchown(改变文件的所有者)
#include <unistd.h> int fchown(int fd, uid_t owner, gid_t group);
fstat(由文件描述词取得文件状态)
#include <sys/types.h> #include <sys/stat.h> #include <unistd.h> int fstat(int fd, struct stat *statbuf);
ftruncate(改变文件大小)
#include <unistd.h> #include <sys/types.h> int ftruncate(int fd, off_t length);
ftw(遍历目录树)
#include <ftw.h> int ftw(const char *dirpath, int (*fn) (const char *fpath, const struct stat *sb, int typeflag), int nopenfd);
get_current_dir_name(取得当前的工作目录)
#include <unistd.h> char *get_current_dir_name(void);
getcwd(取得当前的工作目录)
#include <unistd.h> char *getwd(char *buf);
getwd(取得当前的工作目录)
#include <unistd.h> char *getwd(char *buf);
lchown(改变文件的所有者)
#include <unistd.h> int lchown(const char *pathname, uid_t owner, gid_t group);
link(建立文件连接)
#include <unistd.h> int link(const char *path1, const char *path2);
lstat(由文件描述词取得文件状态)
#include <sys/types.h> #include <sys/stat.h> #include <unistd.h> int lstat(const char *pathname, struct stat *statbuf);
nftw(遍历目录树)
#include <ftw.h> int nftw(const char *dirpath, int (*fn) (const char *fpath, const struct stat *sb, int typeflag, struct FTW *ftwbuf), int nopenfd, int flags);
opendir(打开目录)
#include <sys/types.h> #include <dirent.h> DIR *opendir(const char *name);
readdir(读取目录)
#include <sys/types.h> #include <dirent.h> int readdir(unsigned int fd, struct old_linux_dirent *dirp, unsigned int count);
readlink(取得符号连接所指的文件)
#include <unistd.h> ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize);
realpath(将相对目录路径转换成绝对路径)
#include <limits.h> #include <stdlib.h> char *realpath(const char *path, char *resolved_path);
remove(删除文件)
#include <stdio.h> int remove(const char *pathname);
rename(更改文件名称或位置)
#include <stdio.h> int rename(const char *old, const char *new);
rewinddir(重设读取目录的位置为开头位置)
#include <sys/types.h> #include <dirent.h> void rewinddir(DIR *dirp);
scandir(读取特定的目录数据)
#include <dirent.h> int scandir(const char *dirp, struct dirent ***namelist, int (*filter)(const struct dirent *), int (*compar)(const struct dirent **, const struct dirent **));
seekdir(设置下回读取目录的位置)
#include <dirent.h> void seekdir(DIR *dirp, long loc);
stat(取得文件状态)
#include <sys/types.h> #include <sys/stat.h> #include <unistd.h> int stat(const char *pathname, struct stat *statbuf);
symlink(建立文件符号连接)
#include <unistd.h> int symlink(const char *path1, const char *path2);
telldir(取得目录流的读取位置)
#include <dirent.h> long telldir(DIR *dirp);
truncate(改变文件大小)
#include <unistd.h> #include <sys/types.h> int truncate(const char *path, off_t length);
umask(设置建立新文件时的权限遮罩)
#include <sys/stat.h> mode_t umask(mode_t cmask);
unlink(删除文件)
#include <unistd.h> int unlink(const char *path);
utime(修改文件的存取时间和更改时间)
#include <sys/types.h> #include <utime.h> int utime(const char *filename, const struct utimbuf *times);
utimes(修改文件的存取时间和更改时间)
#include <sys/time.h> int utimes(const char *filename, const struct timeval times[2]);