* 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"
cp --archive --attributes-only ORIGINALFILE NEWFILE (creates an empty file, with the same name and all the same attributes as the original file)
cp --archive ORIGINALFILE NEWFILE (creates a copy of the original file [content, name and all attributes the same])
Thank you for all your work on Xed & all the best for you in 2024!
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!