linuxmint / xed

X-Apps [Text] Editor (Cross-DE, backward-compatible, GTK3, traditional UI)
GNU General Public License v2.0
459 stars 85 forks source link

Saving a file removes Extended Attributes of that file #619

Open Self-Layer opened 11 months ago

Self-Layer commented 11 months ago
 * Xed version 3.4.3
 * Distribution - Linux Mint 21.2

xattr Extended Attributes of a file are lost after saving in XED with option "Create Backup-Copy" active

Steps to reproduce Create a text file Add some extended attributes to that file with "xattr" or "Eiciel" Open that file in Xed Change the file Save the file

Expected behaviour Xed should not change the extended attributes of any file

Other information If one looks at the inode-number (with "ls -i") of the original file, the backup-copy and the saved file (with the original name) then it shows that the backup-copy is the original file that has been renamed, that means it has the extended attributes! The saved file on the other hand is a new file, that contains the changed file content, but has no extended attributes of the original file.

The solution is therefore, that Xed copies the extended attributes to all files that are no longer the original file (meaning the inode-number has changed).

An easy way to do this is to use "cp"

Thank you for all your work on Xed & all the best for you in 2024!