chmod fchmod 系统调用
来源:互联网 发布:ubuntu开机启动服务 编辑:程序博客网 时间:2024/06/06 02:16
#include <stdio.h>#include <fcntl.h>#include <sys/types.h>#include <sys/stat.h>#include <stdlib.h>#define RWXRWXRWX (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH |S_IXUSR | S_IXGRP |S_IXOTH )int main(){struct statstatbuf;umask(0);if(creat("foo", RWXRWXRWX) < 0)printf( "creat error for foo!\n" );umask( S_IWGRP |S_IWOTH | S_IROTH );printf("befor creat bar!\n");if(creat("bar", RWXRWXRWX) < 0 )printf("creat error for bar!\n");if( stat( "foo", &statbuf ) < 0 )printf( "stat foo error !\n" ); if( chmod( "foo", ( statbuf.st_mode & ~S_IRUSR & ~S_IWUSR & ~S_IXUSR) | S_ISUID ) < 0 )printf( "chmod foo error!\n" );exit(0);}
运行结果如下:
- chmod fchmod 系统调用
- chmod、fchmod函数
- chmod 与fchmod函数
- chmod和fchmod函数
- 实战chmod函数 fchmod fchmodat
- chmod,fchmod,and fchmodat Functions
- 4.9 chmod和fchmod函数
- chmod函数 系统调用
- fchmod
- fchmod
- fchmod()
- 《UNIX环境高级编程》笔记--chmod函数和fchmod函数
- 4.9 chmod和fchmod函数-文件权限修改
- uc笔记06---chmod/fchmod,chown/fchown/lchown
- 详细对比C语言中的chmod()函数和fchmod()函数
- linux chmod和fchmod设置 文件和目录权限设置
- linux chmod和fchmod设置 文件和目录权限设置
- unix环境高级编程-4.9-chmod,fchmod函数和粘住位
- java内存原型分析-基本知识
- ORA-01555 总结
- Silverlight 引路蜂二维图形库示例:概述
- java输出程序本身占用的内存
- 在ubuntu下firefox跑Applet
- chmod fchmod 系统调用
- EXT布局类的介绍与使用
- 单片机入门
- IDE/ATA与AHCI
- C语言中常用的标准库函数
- java高并发-静态页面生成方案
- 转载 Socket与TCP/IP的关系 转(非常好的一篇文章!)
- 倒计时对话框,自己写得比较乱
- [MSSQL]固定长度添加分隔符函数