文件操作中的FLAG(O_RDONLY,O_WRONLY )的值

 

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
void main(void)
{
        printf("O_ACCMODE       %08x\n",  O_ACCMODE               ) ; 
        printf("O_RDONLY        %08x\n",  O_RDONLY                ) ; 
        printf("O_WRONLY        %08x\n",  O_WRONLY                ) ; 
        printf("O_RDWR          %08x\n",  O_RDWR                  ) ; 
        printf("O_CREAT         %08x\n",  O_CREAT                 ) ; 
        printf("O_EXCL          %08x\n",  O_EXCL                  ) ; 
        printf("O_NOCTTY        %08x\n",  O_NOCTTY                ) ; 
        printf("O_TRUNC         %08x\n",  O_TRUNC                 ) ; 
        printf("O_APPEND        %08x\n",  O_APPEND                ) ; 
        printf("O_NONBLOCK      %08x\n",  O_NONBLOCK              ) ; 
        printf("O_DSYNC         %08x\n",  O_DSYNC                 ) ; 
        printf("FASYNC          %08x\n",  FASYNC                  ) ; 
        printf("O_NOFOLLOW      %08x\n",  O_NOFOLLOW              ) ; 

}
/*
O_ACCMODE       00000003
O_RDONLY        00000000
O_WRONLY        00000001
O_RDWR          00000002
O_CREAT         00000040
O_EXCL          00000080
O_NOCTTY        00000100
O_TRUNC         00000200
O_APPEND        00000400
O_NONBLOCK      00000800
O_DSYNC         00001000
FASYNC          00002000
O_NOFOLLOW      00020000
*/

 

posted @ 2016-03-21 14:06  oucaijun  阅读(8837)  评论(0编辑  收藏  举报
下载TeamViewer完整版 下载TeamViewer