Find the answer to your Linux question:
Results 1 to 2 of 2
Hello Everybody, After writing some data to a file , then closing the file using fclose function .. then immediately passing the file as an argument to a shell script ...
  1. #1
    Just Joined!
    Join Date
    Jul 2011
    Posts
    3

    problem in file reading and writing in c

    Hello Everybody,

    After writing some data to a file , then closing the file using fclose function .. then immediately passing the file as an argument to a shell script command or opening the file for immediately reading .. Will the data be found correctly or the Operating System will still being writing the file so that if i read something before it finishes it may be some garbage ??

    Thanks in advance,

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    The data, even if not written completely to disc, will be in the system cache, so opening the file with another application or shell script should work just fine.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...