[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Safe File Update (atomic)



On 30/12/10 19:48, Henrique de Moraes Holschuh wrote:

It doesn't.  You need a "copy inode without the file data" filesystem
interface to be able to do that in the first place.  It might exist, but I
never heard of it.


If my (extremely leaky) memory serves me right, Windows has it. It's called "delete and then rename". It is not atomic (since when do Windows care about not breaking stuff), but it does exactly that.

If you delete a file and quickly (yes, this feature is time based) rename a different file to the same name, the new file will receive all metadata information the old file had (including owner, permissions etc.)

Just thought I'd share this little nugget to show you how much worse non-posix has it.

Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com


Reply to: