On Sun, Jan 4, 2009 at 16:26, Adam Osuchowski <ad...@zonk.pl> wrote:

> Nikolai Weibull wrote:

>> 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.

Yeah, so?  That's not a bug.  File systems are, generally, not
databases with ACID properties.  They don't provide transactions (at
the level we're discussing).

>> but would opening the file exclusively solve the problem?

> 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.

No, I mean both O_EXCL (so that a file hasn't been created in between
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
either).

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui