|
|
我在主函数中使用了:<sys/types.h>,<sys/stat.h>
主函数中调用了system()和umask(),
我用“gcc -c 源文件 -o 目标文件”,然后查看目标文件提示说是cann't excute binary file
,为什么呢??
#include <sys/stat.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
mode_t newmask=0222,oldmask;
system("touch new");
oldmask=umask(newmask);
printf("new is %o\n",newmask);
printf("old is %o\n",oldmask);
system("touch old");
exit(EXIT_SUCCESS);
} |
|