Moving open files

Derek Broughton news at pointerstop.ca
Mon Jul 7 13:51:26 UTC 2008


Dotan Cohen wrote:

> A user recently found that Ubuntu has a dataloss danger when moving
> open files. To confirm:
> 1) Open file in OOo.
> 2) Move file to other location.
> 3) Make changes to file in OOo.
> 4) Save file in OOo.
> 
> Who's responsibility is it to make sure that files in use are either
> not moved, or that saves to the file are performed on the file's new
> location? Is this the responsibility of OOo, KDE, or the Linux kernel?
 
It can't be KDE's, because OO isn't a KDE app.

What, exactly, is the loss?  I can imagine a situation where a program opens
a file, reads it, closes it, and later writes it (complete) - if the file
is moved in the meantime, there will be two copies, one as it was when the
program first opened it, and one that was written out.  That would just be
a program "feature", and not really a data loss.  otoh, if OO is trying to
write back some sort of delta to the original file, but the original file
is gone, that's got to be OO's fault - it has to keep the file open if it's
going to do that, and write to the open file handle, not to the file _name_
(and if it's doing that, and it doesn't work, I'd say it's a kernel bug).

If the file _is_ kept open, it may be possible to move it within a
filesystem in the meantime, but shouldn't be possible to move it to another
FS.
-- 
derek





More information about the ubuntu-users mailing list