I'd like to have a 'mdset' utility also, with which it would be
possible to
set arbitrary kMDItem* attributes at will from the commandline.
I am not a programmer, so I would need some experts with me to
update and fix the openmeta cli code correctly.
greetz
=:-)f
- changed the special treatment of commas (silly assumption a user
expect commas to be treated as a delimiter on commandline tool)
- changed '-v' to make openmeta cli verbose, not to make it silent
(look at other cli tools: admins make a utility verbose by ADDING '-
v')
- added new switch '-x <keyname>' , but this does not work so far
not to far away from a 'mdset <keyname> <attribute> <file>' tool
=:-)f
@tom.andersen
I can set an kMDItem.. attribute to a file with '-s' and get it listed
by mdls! (kMDItemIdentifier)
If I do add the same kMDItem... attribute to a file, mdls does NOT
list it, it seems to be erased.
I don't think I changed much in openmeta cli code, and did not change
anything about '-a', '-s'.
So I do not understand why its deleted when ADDING.
Do leap, yep, ... call the CLI?
=:-)f
-s 'sets' the information, erasing any previous.
When adding info - you have to remember that it only makes sense to add information that is an array. So if you have your own kMDItemIdentifier - it will likely not be setting an array of data.
try xattr -l in terminal after you set or add attributes. That's all the cli does is set xattr for you.
--Tom
> --
> You received this message because you are subscribed to the Google Groups "OpenMeta" group.
> To post to this group, send email to open...@googlegroups.com.
> To unsubscribe from this group, send email to openmeta+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/openmeta?hl=en.
>
adding does definitly erase parts of the information!
------------------------- setting an attribute --------- then reading
it
-----------------------------------------------------------------------------------------------
$ ~/Documents/openmeta-read-only/trunk/openmeta/build/Release/openmeta
-x kMDItemIdentifier -s "mit zwei" -p ./bcedit.cfg
$ ls -l@ bcedit.cfg
-rw-r--r--@ 1 fo03c 502 409 15 Mai 2006 bcedit.cfg
com.apple.metadata:kMDItemIdentifier 50
com.apple.metadata:kMDItemOMUserTagTime 50
com.apple.metadata:kMDItemOMUserTags 53
com.apple.metadata:kOMUserTags 53
org.openmetainfo.time:kMDItemIdentifier 50
org.openmetainfo.time:kMDItemOMUserTagTime 50
org.openmetainfo.time:kMDItemOMUserTags 50
org.openmetainfo:kMDItemIdentifier 50
org.openmetainfo:kMDItemOMUserTagTime 50
org.openmetainfo:kMDItemOMUserTags 53
org.openmetainfo:kOMUserTags 53
------------------------- ADDING an attribute --------- then reading
it
-----------------------------------------------------------------------------------------------
$ ~/Documents/openmeta-read-only/trunk/openmeta/build/Release/openmeta
-x kMDItemIdentifier -a "mit zwei" -p ./bcedit.cfg
$ ls -l@ bcedit.cfg
-rw-r--r--@ 1 fo03c 502 409 15 Mai 2006 bcedit.cfg
com.apple.metadata:kMDItemOMUserTagTime 50
com.apple.metadata:kMDItemOMUserTags 53
com.apple.metadata:kOMUserTags 53
org.openmetainfo.time:kMDItemIdentifier 50
org.openmetainfo.time:kMDItemOMUserTagTime 50
org.openmetainfo.time:kMDItemOMUserTags 50
org.openmetainfo:kMDItemOMUserTagTime 50
org.openmetainfo:kMDItemOMUserTags 53
org.openmetainfo:kOMUserTags 53
$ mdls bcedit.cfg
kMDItemContentCreationDate = 2006-05-15 12:10:27 +0200
kMDItemContentModificationDate = 2006-05-15 12:10:27 +0200
kMDItemContentType = "dyn.ah62d4rv4ge80g3xh"
kMDItemContentTypeTree = (
"public.data",
"public.item"
)
kMDItemDisplayName = "bcedit.cfg"
kMDItemFSContentChangeDate = 2006-05-15 12:10:27 +0200
kMDItemFSCreationDate = 2006-05-15 12:10:27 +0200
kMDItemFSCreatorCode = ""
kMDItemFSFinderFlags = 0
kMDItemFSHasCustomIcon = 0
kMDItemFSInvisible = 0
kMDItemFSIsExtensionHidden = 0
kMDItemFSIsStationery = 0
kMDItemFSLabel = 0
kMDItemFSName = "bcedit.cfg"
kMDItemFSNodeCount = 0
kMDItemFSOwnerGroupID = 502
kMDItemFSOwnerUserID = 10003
kMDItemFSSize = 409
kMDItemFSTypeCode = ""
kMDItemKind = "Dokument"
kMDItemLastUsedDate = 2006-05-15 12:10:27 +0200
kMDItemOMUserTags = (
"mit zwei"
)
kMDItemOMUserTagTime = 2010-03-04 21:00:23 +0100
kMDItemUsedDates = (
"2006-05-15 00:00:00 +0200"
)
kOMUserTags = (
"mit zwei"
)
------------------------- setting an attribute --------- then reading
it
-----------------------------------------------------------------------------------------------
$ ~/Documents/openmeta-read-only/trunk/openmeta/build/Release/openmeta
-x kMDItemIdentifier -s "mit zwei" -p ./bcedit.cfg
$ mdls bcedit.cfg
kMDItemContentCreationDate = 2006-05-15 12:10:27 +0200
kMDItemContentModificationDate = 2006-05-15 12:10:27 +0200
kMDItemContentType = "dyn.ah62d4rv4ge80g3xh"
kMDItemContentTypeTree = (
"public.data",
"public.item"
)
kMDItemDisplayName = "bcedit.cfg"
kMDItemFSContentChangeDate = 2006-05-15 12:10:27 +0200
kMDItemFSCreationDate = 2006-05-15 12:10:27 +0200
kMDItemFSCreatorCode = ""
kMDItemFSFinderFlags = 0
kMDItemFSHasCustomIcon = 0
kMDItemFSInvisible = 0
kMDItemFSIsExtensionHidden = 0
kMDItemFSIsStationery = 0
kMDItemFSLabel = 0
kMDItemFSName = "bcedit.cfg"
kMDItemFSNodeCount = 0
kMDItemFSOwnerGroupID = 502
kMDItemFSOwnerUserID = 10003
kMDItemFSSize = 409
kMDItemFSTypeCode = ""
kMDItemIdentifier = "mit zwei"
kMDItemKind = "Dokument"
kMDItemLastUsedDate = 2006-05-15 12:10:27 +0200
kMDItemOMUserTags = (
"mit zwei"
)
kMDItemOMUserTagTime = 2010-03-04 21:01:24 +0100
kMDItemUsedDates = (
"2006-05-15 00:00:00 +0200"
)
kOMUserTags = (
"mit zwei"
)
$
greetz
=:-)f
there are a couple of attributes where an array does not make any
sense: kMDItemAcquisitionModel, kMDItemAudioSampleRate, ...
from reading through the forums I believe you are rather fixed on
'tagging'.
For me 'tagging' is only a small part of the whole metadata story.
Yes, there are many attributes which are best suited as arrays, but it
simply depends on the case.
No general assumptions, please. Let there be freedom of choice.
BTW: I just used the first array-element to set an arbitrary
attribute when changing your code.
greetz
=:-)f
How does it make sense to 'add' something to an attribute that is not an array?
ie what do you expect to happen when you add '44100' to the kMDItemAudioSampleRate?
It does look like a bug though - I think that the adding code must get confused when there is no array but rather a single item.
--Tom