miko3k |
12-06-2004 07:02 AM |
write to /dev/full is successful !!! what the hell :)
t have written a simple program which writes 100 bytes to /dev/full and it works!!! what the hell ? see below how i figured it out...
Code:
miko@miko:~/tmp$ cat > a.c
#include <stdio.h>
int main(void)
{
char str[100];
FILE *f;
if(!(f=fopen("/dev/full","w"))) {
printf("fuck fuck fuck\n");
return 1;
}
printf("%d\n",fwrite(str,1,100,f));
return 0;
}
miko@miko:~/tmp$ gcc a.c
miko@miko:~/tmp$ ./a.out
100
miko@miko:~/tmp$ cat a.c > /dev/full
cat: write error: No space left on device
what's wrong with my code ? please help me!!
|