is somebody willing to 'clear-out' the bugs in openmeta cli?

78 views
Skip to first unread message

mc23646266

unread,
Mar 1, 2010, 5:17:54 AM3/1/10
to OpenMeta
there are some bug-reports open for the openmeta cli for a long time,
which are not 'accepted' and not cared about.

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

mc23646266

unread,
Mar 2, 2010, 6:32:36 PM3/2/10
to OpenMeta
downloaded the source from trunk.
Most of my issues with the openmeta cli an be changed easily as most
of the functionallity is already in the code:

- 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

mc23646266

unread,
Mar 4, 2010, 5:34:49 AM3/4/10
to OpenMeta
ok, after some more slight changes I almost got a 'mdset' version of
openmeta cli.

@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

Tom Andersen

unread,
Mar 4, 2010, 9:53:59 AM3/4/10
to open...@googlegroups.com
Leap and Yep, etc don't call the cli.

-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.
>

mc23646266

unread,
Mar 4, 2010, 3:27:10 PM3/4/10
to OpenMeta
@tom.andersen
the problem with xattr is: it does not 'encode' the arguments to the
required bin plist format, so it is useless to use it for setting
attributes.
ok, leap .... don't use the cli, nevertheless I do think there's
something wrong here:

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

mc23646266

unread,
Mar 4, 2010, 3:42:40 PM3/4/10
to OpenMeta
@tom.andersen
I cannot follow your thesis for: ' it only makes sense to add
information that is an array'

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

Tom Andersen

unread,
Mar 4, 2010, 3:51:06 PM3/4/10
to open...@googlegroups.com
Tags are arrays - you can add to them.

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

Reply all
Reply to author
Forward
0 new messages