Bug 354405 - QSaveFile: Files are unlinked upon save
Summary: QSaveFile: Files are unlinked upon save
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 3.13.0
Platform: Debian unstable Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-26 14:33 UTC by Salvo "LtWorf" Tomaselli
Modified: 2018-08-18 09:14 UTC (History)
2 users (show)

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 Salvo "LtWorf" Tomaselli 2015-10-26 14:33:57 UTC
When I edit a file that has multiple aliases, after saving they are effectively duplicated into different files.

Reproducible: Always

Steps to Reproduce:
touch "file1"
ln file1 file2
kwrite file1
write something into kwrite and save

Actual Results:  
The files differ

Expected Results:  
They shouldn't differ

The proper behaviour would be to truncate() and then write() if you want to delete the entire content and re-write it. This way the inode remains the same.
Comment 1 Buovjaga 2016-07-10 11:03:38 UTC
Reproduced with Kate.

Arch Linux 64-bit
Kate 16.04.2
KDE Frameworks 5.23.0
Qt 5.7
xcb wm
Comment 2 Christoph Cullmann 2018-08-18 09:14:40 UTC
Remove QSaveFile in favor of plain old file saving

Summary: Rationale: for many use cases that e.g. have acls, complex other extended attributes, static links e.g. the rename() doesnt do the trick it should other ways would be start to add workarounds to all cases, which is hard, e.g. if that is something shared via SMB...

Test Plan: make && make test

Reviewers: dhaumann, dfaure

Reviewed By: dhaumann, dfaure

Subscribers: dfaure, kwrite-devel, kde-frameworks-devel

Tags: #kate, #frameworks

Differential Revision: https://phabricator.kde.org/D14890