[colug-432] Troubleshooting Suggestions: File Truncation Issue

Jeff Frontz jeff.frontz at gmail.com
Tue Jan 12 01:03:07 EST 2016


On Sun, Jan 10, 2016 at 10:31 AM, Jeff Frontz <jeff.frontz at gmail.com> wrote:

> On Sat, Jan 9, 2016 at 11:13 PM, William E. T. <linux.hacker at gmail.com>
> wrote:
>
>> 1.   Opens a new file
>> 2.  Writes to the file
>> 3.  Closes the file
>> 4.  Creates a link to its real name
>> 5.  Removes the original file
>> 6.  stats the file to find a zero size
>>
>
Thinking about this some more-- you could add a busy-wait loop as step 2.5:
call fstat() on the open file descriptor and then repeatedly call stat() on
the filename (maybe with a call to sched_yield() thrown in) until the sizes
returned are equal.

Jeff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.colug.net/pipermail/colug-432/attachments/20160112/3d2db688/attachment-0001.html 


More information about the colug-432 mailing list