rename和renameat函数
- #include <stdio.h>
-
- int rename(const char *oldname,const char *newname);
- int renameat(int oldfd,const char *oldname,int newfd,const char *newname);
- #include <unistd.h>
-
- int symlink(const char *actualpath,const char *sympath);
- int symlinkat(const char *actualpath,int fd,const char *sympath);
打开该链接本身,并读取该链接中的名字。readlink和readlinkat函数提供了这种功能。
- #include <unistd.h>
-
- ssize_t readlink(const char *restrict pathname,char *restrict buf,size_t bufsize);
- ssize_t readlinkat(int fd,const char *restrict pathname,size_t bufsize);
futimens和utimensat函数可以指定纳秒级精度的时间戳。
- #include <unistd.h>
-
- int futimes(int fd,const struct timespec times[2]);
- int utimensat(int fd,const char *path,const struct timespec times[2],int flag);
futimes和utimensat函数都包含在POSIX.1中,第3个函数utimes包含在Single UNIX Specification的XSI扩展中。
- #include <sys/time.h>
-
- int utimes(const char *pathname,const struct timeval times[2])