donno20 has asked for the wisdom of the Perl Monks concerning the following question:
I was facing a problem like this.
Open a file handler by using the open function and made some changes on its, then close the file handler. Checked the file and it was updated.
let's say there is a second program (or routine) open the same file (for reading only), immediately after the one above, I found out that the file will be reverted back to its original contents.
This problem appear unless I issue sync command with system("sync") in between both of the programs(routines) above.
So what happen behind ? Why should I issued sync ? Isn't it the file was updated and save properly after I close the file handler in the first program ?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: A file revert back to its original contents
by tachyon (Chancellor) on Apr 11, 2003 at 05:26 UTC | |
|
Re: A file revert back to its original contents
by MarkM (Curate) on Apr 11, 2003 at 04:06 UTC | |
by donno20 (Sexton) on Apr 11, 2003 at 04:41 UTC | |
by jasonk (Parson) on Apr 11, 2003 at 13:52 UTC |