[Libreoffice-bugs] [Bug 125401] FILESAVE: Saving a document creates a new file (new inode number) thereby messing-up with the creation time of the document

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Wed May 29 14:50:18 UTC 2019


https://bugs.documentfoundation.org/show_bug.cgi?id=125401

--- Comment #5 from Alex <alex.dwd at gmail.com> ---
Some additional thoughts.

Reading about the g_file_set_contents() function[1] it points to the fact that
changing the inode number also breaks existing hard links to the original file
(wow!).

I don't know how it is done exactly at the code level, but to solve both the
'creation time' (crtime) and 'hard link' issues, here is another suggestion:
why not overwrite the content of the original file with the content of the
temporary file rather than overwriting the file itself?

To avoid the risk of losing any information in case of crash (whether the
original data or the new data), just before the overwriting of the content an
additional temporary copy of the original file could be created. This would
preserve the content of that file in case of crash in the process of writing.

Added to note: mind that ctime (change time) and crtime (creation time) are
different attributes.


[1]
https://developer.gnome.org/glib/stable/glib-File-Utilities.html#g-file-set-contents

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20190529/f1b9d205/attachment.html>


More information about the Libreoffice-bugs mailing list