Moving open files

Ed Greshko Ed.Greshko at greshko.com
Mon Jul 7 15:21:39 UTC 2008


Dotan Cohen wrote:
> 2008/7/7 Derek Broughton <news at pointerstop.ca>:
>> It can't be KDE's, because OO isn't a KDE app.
>>
> 
> KDE's Dolphin was used to move the file, I should have been clearer.
> 
>> What, exactly, is the loss?
> 
> The original file (in the new location) does not contain the changes.
> You could argue that the changes remain in the old location, but the
> user does not know to even look there. For him, the data is lost.
> 
>> 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).
>>
> 
> As Carl-Mitchell mentioned, OOo should have locked the file. I am
> unfamiliar with file locks, but now that I know about the problem I
> will try to reproduce it locally and file a bug at OOo.
> 
>> 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.
> 
> That's good to know, thanks.

I think you will find that your "bug" will be rejected......

First thing you should be aware of is that OO does not work on any of the 
documents you open directly.  It creates copies in a tmp directory and it 
works on that copy, plus what it keeps in memory.  This allows it to keep 
track of changes and easily create an undo and redo list.  These temp files 
are also used in the event a recovery is needed.

OO is oblivious to you having moved the file.  When you hit "save" it simply 
  overwrites the existing file (if it exists) or creates a file if it doesn't.

Bottom line, there is no way for the mv command to signal OO that the file 
has been moved or renamed.

Everything is working as designed and the users gain some understanding.




More information about the ubuntu-users mailing list