Lines Matching defs:file

116 	printf ("0) Create a file, write %d bytes and close it.\n", SIGNED_SIZEOF (data)) ;
126 printf ("1) Re-open file in read/write mode and write another %d bytes at the end.\n", SIGNED_SIZEOF (data)) ;
136 printf ("2) Now use system (\"%s %s\") to show the file length.\n\n", dir_cmd, filename) ;
147 printf ("3) Now use fstat() to get the file length.\n") ;
153 printf ("4) According to fstat(), the file length is %ld, ", (long) statbuf.st_size) ;
176 printf ("0) Create a file, write %d bytes and close it.\n", SIGNED_SIZEOF (data)) ;
186 printf ("1) Re-open file in read/write mode and write another %d bytes at the end.\n", SIGNED_SIZEOF (data)) ;
197 printf ("2) Now use system (\"%s %s\") to show the file length.\n\n", dir_cmd, filename) ;
208 printf ("3) Now use lseek() to go to the end of the file.\n") ;
236 printf ("0) Create a file and write %d bytes.\n", SIGNED_SIZEOF (data)) ;
247 printf ("1) Now call stat and fstat on the file and retreive the file lengths.\n") ;
282 FILE * file ;
285 puts ("\nWrite to closed file test.\n--------------------------") ;
287 printf ("0) First we open file for write using fopen().\n") ;
288 if ((file = fopen (filename, "w")) == NULL)
293 printf ("1) Now we grab the file descriptor fileno().\n") ;
294 fd = fileno (file) ;
296 printf ("2) Write some text via the file descriptor.\n") ;
299 printf ("3) Now we close the file using fclose().\n") ;
300 fclose (file) ;
305 printf ("4) Now write more data to the file descriptor which should fail.\n") ;
309 { printf ("5) Attempting to write to a closed file should have failed but didn't! *** WRONG ***\n") ;