C 中的任何系统调用都可以更改 HP-UX 中文件的权限??
最佳答案
请参阅 sys/stat.h
中的 chmod
( documentation )。下面的示例来自文档。 HP-UX 符合 POSIX,因此您可以使用这些函数以及 C 库中的标准函数。
The following example sets the file permission bits for a file named /home/cnd/mod1, then calls the stat() function to verify the permissions.
#include <sys/types.h>
#include <sys/stat.h>
int status;
struct stat buffer
...
chmod("home/cnd/mod1", S_IRWXU|S_IRWXG|S_IROTH|S_IWOTH);
status = stat("home/cnd/mod1", &buffer;);
关于c - C 中的任何系统调用以更改 HP-UX 中文件的权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5551557/