|
|
От: | nimdator | |
| Дата: | 16.12.04 15:29 | ||
| Оценка: | |||
/* test.c */
int main () {
char* src_path="TEMP/ttt.txt";
FILE* iop;
int fildes;
fildes=open(src_path, O_EXCL || O_WRONLY);
printf("fildes = %d\n", fildes);
close(fildes);
iop=fopen(src_path,"w");
fildes=ftrylockfile(iop);
printf("fildes = %d\n", fildes);
fclose(iop);
return 0;
}$> dd if=/dev/zero of=TEMP/ttt.txt bs=1 count=1000000 &
$> test
fildes = 3
fildes = 0
$>