Skip to main content
Became Hot Network Question
deleted 4 characters in body
Source Link
user480875
user480875

Is it possible to copy an individual file and preserve its comment?

Here is what I have tried. Nothing here works for me on macOS 14.3.1 and Zsh zsh 5.9 (x86_64-apple-darwin23.0).

cp file.txt file-copy.txt
cp -a file.txt file-copy.txt
rsync file.txt file-copy.txt
rsync -E file.txt file-copy.txt

The tags (red, orange, etc.) are always preserved, but not the comment.

If you run xattr file-copy.txt, you will see that the com.apple.metadata:kMDItemFinderComment extended attribute itself is preserved, but if you run mdls -name kMDItemFinderComment file-copy.txt you will see that its value is "".

Is it possible to copy an individual file and preserve its comment?

Here is what I have tried. Nothing here works for me on macOS 14.3.1 and Zsh zsh 5.9 (x86_64-apple-darwin23.0).

cp file.txt file-copy.txt
cp -a file.txt file-copy.txt
rsync file.txt file-copy.txt
rsync -E file.txt file-copy.txt

The tags (red, orange, etc.) are always preserved, but not the comment.

If you run xattr file-copy.txt, you will see that the com.apple.metadata:kMDItemFinderComment extended attribute itself is preserved, but if you run mdls -name kMDItemFinderComment file-copy.txt you will see that its value is "".

Is it possible to copy an individual file and preserve its comment?

Here is what I have tried. Nothing here works for me on macOS 14.3.1 and Zsh 5.9 (x86_64-apple-darwin23.0).

cp file.txt file-copy.txt
cp -a file.txt file-copy.txt
rsync file.txt file-copy.txt
rsync -E file.txt file-copy.txt

The tags (red, orange, etc.) are always preserved, but not the comment.

If you run xattr file-copy.txt, you will see that the com.apple.metadata:kMDItemFinderComment extended attribute itself is preserved, but if you run mdls -name kMDItemFinderComment file-copy.txt you will see that its value is "".

edited tags; edited tags
Link
bmike
  • 241.3k
  • 80
  • 433
  • 958
edited title
Link
user480875
user480875

To copy an individuala file and preserve its comment

Source Link
user480875
user480875
Loading