lundi 9 mars 2015

Mac OS X - set file metadata attribute values?


Mac OS X Yosemite : I'm trying to set the values of some file metadata attributes - kMDItemDateAdded and kMDItemLastUsedDate - the values of which can be shown using mdls <filename>. I'm trying to set their values using xattr.


I've tried this:



xattr -w com.apple.metadata:kMDItemDateAdded "2001-01-01 12:34:56 +0000" some_file.txt
xattr -w com.apple.metadata:kMDItemLastUsedDate "2001-01-01 12:34:56 +0000" some_file.txt


I've tried this:



xattr -w kMDItemDateAdded "2011-01-01 12:34:56 +0000" some_file.txt
xattr -w kMDItemLastUsedDate "2011-01-01 12:34:56 +0000" some_file.txt


...but have had no success. xattr reports no errors, but the file metadata attribute values are left unchanged.


Do you know if what I'm trying to do is possible, and if it is, where I'm going wrong?





Aucun commentaire:

Enregistrer un commentaire