access と faccessat でファイルの存在と権限を点検
2019-10-24


access と faccessat と言うシステムコールがあって、ファイルの存在を調べる時やファイルのアクセス権限を手軽に調べる時は、stat や open などよりも手軽に出来る。

man だとこんな感じ。

% man access
...
       access, faccessat - determine accessibility of a file

SYNOPSIS
       #include &ltunistd.h>
       #include &ltsys/fcntl.h>

       int access(const char *path, int amode);

       int faccessat(int fd, const char *path, int amode, int flag);
[C 言語]
[unix]

コメント(全0件)
コメントをする


記事を書く
powered by ASAHIネット