52906Re: Race condition during file saving
- Jan 4, 2009On Sun, Jan 4, 2009 at 16:26, Adam Osuchowski <adwol@...> wrote:
> Nikolai Weibull wrote:Yeah, so? That's not a bug. File systems are, generally, not
>> I haven't really understood what the problem is (I don't believe that
>> there actually is one),
> There is a non-zero time period between open file and write complete
> content. Because vim truncate file while opening (O_TRUNC), another
> process which would like to read it can hit in the moment when file will
> be empty.
databases with ACID properties. They don't provide transactions (at
the level we're discussing).
>> but would opening the file exclusively solve the problem?No, I mean both O_EXCL (so that a file hasn't been created in between
> Do you mean O_EXCL flag to open syscall? It doesn't protect against
> such a situation. It only guarantee that file doesn't exist prior to
> call open in atomic manner.
the time the original file has been renamed and the new one opened - a
case so far not mentioned (or?)) and flock:ing it (but, as I
understand from the man page, this doesn't seem to be very interesting
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
- << Previous post in topic Next post in topic >>