2009-05-30から1日間の記事一覧

openとchmod

apropos chmodコマンドで数パターンのmanコマンドがあるのが確認できる。 man 2 chmodでc言語で使う関数の方が確認できる。 #include <stdio.h> #include <fcntl.h> #include <sys/stat.h> int main(){ int fp; fp = open ("foobar.txt", O_WRONLY | O_CREAT); if(fp != -1) chmod("foobar</sys/stat.h></fcntl.h></stdio.h>…