版權所有 © 2014 tutorialspoint
futimes - 相對於目錄檔案描述符更改檔案的時間戳
#include <fcntl.h> int futimesat(int dirfd, const char *path, const struct timeval times[2]);
int futimesat(int dirfd, const char *path, const struct timeval times[2]);
futimesat() 系統呼叫與 utimes(2) 的操作方式完全相同,除了本手冊頁中描述的差異。
如果 pathname 中給定的路徑名是相對路徑,則將其解釋為相對於檔案描述符 dirfd 所指的目錄(而不是相對於呼叫程序的當前工作目錄,utimes(2) 對相對路徑名就是這樣做的)。
如果 pathname 中給定的路徑名是相對路徑,並且 dirfd 是特殊值 AT_FDCWD,則 pathname 將相對於呼叫程序的當前工作目錄進行解釋(就像 utimes(2) 一樣)。
如果 pathname 中給定的路徑名是絕對路徑,則忽略 dirfd。
成功時,futimesat() 返回 0。錯誤時,返回 -1,並且 errno 被設定為指示錯誤。
utimes(2) 發生的相同錯誤也可能發生在 futimesat() 中。以下其他錯誤可能發生在 futimesat() 中
此係統呼叫是非標準的,但建議將其包含在 POSIX.1 的未來修訂版中。Solaris 上存在類似的系統呼叫。
如果 path 引數為 NULL,則 glibc futimes() 包裝函式會更新 dirfd 所指的檔案的時間。
futimesat() 在 Linux 核心 2.6.16 中新增。
path_resolution (2)
stat (2)
utimes (2)
廣告