[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [Bug 76942] file saving, consider vi like save to new file, unlink old,
From:       "Casteyde.Christian" <casteyde.christian () free ! fr>
Date:       2005-12-20 22:33:31
Message-ID: 20051220223331.18898.qmail () ktown ! kde ! org
[Download RAW message or body]

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
         
http://bugs.kde.org/show_bug.cgi?id=76942         




------- Additional Comments From casteyde.christian free fr  2005-12-20 23:33 -------
Hmmm. For #10 I would propose:
"Keep backup file after save" (default on)

As far as the location of backup files, that could be a great idea, since removing \
backup files is generally wanted because they spread all other the file system... \
But: Removing the option is not dangerous anymore if a backup file is always done. \
Moreover, moving files across filesystems is really not safe either. And a naming \
convention should be chosen, because several files with the same name must not use \
the same backup file.

I certainly lost several files due to full filesystems, and it would be a pity to \
crash at saving because the backup directory is full! In fact, using a temporary \
backup file is not only a safer way of doing a save command, it's also the best way \
to determine if the filesystem has enough free space to accept the new file.

As far as #12 is concerned, I don't understand. Why not doing simply:
1. Save to temporary
2. Rename foo to foo~
3. Rename temporary to foo
4. If backup must be erased, unlink foo~?
I thought renaming a file didn't change the hard link count...

Anyway, I have a conceptual problem with this hard link stuff. If a file is hard \
linked, I expect any modification in it to be visible in all links (having a warning \
could be interesting btw at this point)! Vi does this: it modify the file's content, \
not the name and the link count! (and the backup file is apparently a copy of the \
previous). Simply saving in another file and renaming everything don't permit this.

I would therefore propose more complex but (IMHO) safer and more logical way:
1. Save "New foo" to temporary. This is vital, because we want data to be on disk.
2. If backup should be done, copy "foo" to foo~. We cannot rename or link, since this \
would change the inode of foo, which is not the role of a text editor. 3. Copy \
temporary file's content to foo's content. 4. If succeeded, unlink temporary file.

This takes 2x the size of the content on disk to save (1x only if no backup), due to \
the explicit copy of foo to foo~ while the temporary is still there. This also takes \
x2 in time (due to the last copy). But I still consider this as more coherent.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic