2

After copying files to an NTFS and FAT Extended devices, I ended up with numerous misplaced finder attributes, due to the broken NTFS and FAT support in OSX's Finder. I.e. I get these can't be changed because they are in use errors, when trying to access any file, but non-finder apps access them fine, although say cp preserves attributes while copying, so attribute hell spreads like virus by copying.

How do I just delete all attributes at once? Instead of doing xattr -d com.apple.FinderInfo file.ext for each file? Is there some hidden folder where OSX stores metadata? Because Neither FAT or NTFS support the OSX's metadata streams.

2 Answers 2

1

rm ._* does the trick for FAT, which has attributes are stored in these ._ prefixed files, but doesn't work for NTFS, which embeds them into filesystem.

1

The xattr way is probably the only way that works. To bulk change, you can use the find command along with it:

find . -iname "*" -exec xattr -d com.apple.FinderInfo {} \;

This calls the command for every file recursively from the current folder upwards. To use another folder, just exchange . for the path you want. Also, this does not change hidden files. You’d need to use -iname ".*" instead of -iname "*" for that.

5
  • I'm pretty sure -xattrname would be order of magnitude faster than -iname, and calling xattr for each file on slow external drive. Commented Nov 16, 2019 at 14:13
  • Then why ask the question if you know the answer already? Looking for a different way? Commented Nov 16, 2019 at 15:52
  • I'm looking for a way to do it properly, like pruning some NTFS alt-stream or deleting a hidden file, instead of using xattr, which is non-portable and slow. Commented Nov 17, 2019 at 16:05
  • The attributes are stored in the file system. FAT does not support permissions and attributes but NTFS does. As you correctly determined that’s why you can only work with xattr. If I remember correctly, it’s a Python script so you may get it to run elsewhere. Other than that, you’re going to need an NTFS specialist to help you identify and change the file system level data. Commented Nov 18, 2019 at 10:15
  • Unfortunately Apple's NTFS driver is read-only, and 3rd party drivers all have their own API, so each of them can store these locks differently. Commented Nov 19, 2019 at 11:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .