c - C 中的任何系统调用以更改 HP-UX 中文件的权限

标签 c hp-ux

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/

上一篇:C输出题

下一篇:c - 我用错了memcpy吗?

相关文章:

C - while 循环中的 fscanf 跳过用户输入

linux - -x 和 -c 字符串比较选项有什么作用?

java - 在 HP-UX 机器上忽略高于 32767 的 DB2 queryDataSize

c - 在 ((struct str_name*)p)->str_dataitem 中使用 const void *;

c - 减号运算符用作一元按位运算

c - C 中函数调用指针的问题

java - JVM 时间同步选项

c++ - Debug 中不满足的符号但不是 Release

c - 游程代码解码中数组的奇怪行为