Bug 376937 - kwrite creates new file as opposed to updting exiting file
Summary: kwrite creates new file as opposed to updting exiting file
Status: RESOLVED DUPLICATE of bug 358457
Alias: None
Product: kate
Classification: Applications
Component: kwrite (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-26 01:36 UTC by Andrew S
Modified: 2017-02-26 16:58 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew S 2017-02-26 01:36:30 UTC
Just upgraded from CentOS6 to CentOS 7 and hence from kwrite 4.3.4
to kwrite 4.14.8.
This version of kwrite always creates a new file as opposed to updating the 
exiting file, i.e. the file i-node changes. For the most part this does
not matter, but does have subtle implications:
a) this means I cannot edit a file to which I have write access, but is located in a directory where I don't have write access; and
b) this breaks any exiting hard-links to the file.
Comment 1 Dominik Haumann 2017-02-26 16:58:44 UTC
The reason for this is that we use QSaveFile [1] to safely save data to disk: It saves to a temporary file, and on success, the temporary file is moved to the final location. This leads to this bug, bug avoids data loss in case of a crash (e.g. power outage). Let's track this in bug #358457.

We track these problems here:
- https://bugs.kde.org/show_bug.cgi?id=354405 Files are unlinked on save
- https://bugs.kde.org/show_bug.cgi?id=358457 Kate removes hard links
- https://bugs.kde.org/show_bug.cgi?id=333577 Kate changes file owner

[1] http://doc.qt.io/qt-5/qsavefile.html

*** This bug has been marked as a duplicate of bug 358457 ***