Moving open files

Derek Broughton news at pointerstop.ca
Tue Jul 8 13:21:55 UTC 2008


Dotan Cohen wrote:

> When a human moves a stapler from one drawer to another, he has no
> reason to suspect that any modification to the stapler (such as
> refilling it) would cause a duplicate stapler to appear in the old
> drawer. Likewise with the movement of open files. This seems to be a
> real 'gotcha' or trap that one could very easily fall into.

Oh, come on.  That's a specious example.  In fact, the situation here is
more like the person taking the staples _out_ of the stapler and putting
them in another stapler, and then being surprised to find that somebody
else put staples into the original.  

There's no possible way for OO or _any_ other program to know what somebody
has done with a file outside that program, and that's as true in Windows as
Linux (and even though Word would lock the file, it _is_ possible to open
it with other Windows applications).  The best an application can do is
compare the original file (or a checksum of it) to the current file before
writing to it, and warn the user if it has been changed.
-- 
derek





More information about the ubuntu-users mailing list