filename | 開くファイル名。 The name of the file to open. |
mode | 開くモード。
関数fopenの第2引数と同じであるが、
利用可能なモードは下記のものに制限される。 The mode to open, which is same as the 2nd argument of function fopen. However, available modes are restricted to the following ones:
Note that this function has been checked for only the following four modes: "w", "wb", "a", "ab". This means that no check has been done for mixed reading/writing modes (e.g., "r+", "w+", "a+") and thus using these modes is strongly discouraged. |
while(1){ fp=fopen(filename,mode); if(fp!=NULL){ if(filelock_enabled==′y′){ stat(filename,&file_stat); chmod(filename,file_stat.st_mode|S_ISGID); } lockf(fileno(fp),F_LOCK,0); break; } } |