setUserTags not really setting?

26 views
Skip to first unread message

MacPrawn

unread,
Feb 2, 2011, 6:39:54 AM2/2/11
to OpenMeta
Hi everyone - I have a weird one.

I use setUserTags:path: to set some data on a file. No error is
reported. I even traced each line as it executed, everything looks
good. In the debugger, after the call, I can also read the tags back
and get the new values. However, if I fire-up the command line, and
use mdimport to look at the data on that file, the only openmeta data
in there is :EA:kMDItemOMUserTagTime - no :EA:kMDItemOMUserTags or
kOMUserTags...

To make things weirder, at least in my mind, if I move the code that
sets the meta data to another thread
(detachNewThreadSelector:toTarget:withObject:), everything works
fine...

Anyone has any idea why moving the code to a separate thread would
make a difference? Any help greatly appreciated.

Thanks!

Tom Andersen

unread,
Feb 2, 2011, 10:29:56 AM2/2/11
to open...@googlegroups.com, OpenMeta
Hi,

I think that if a file is created or modified, mdimport will import it. If you somehow manage to set tags on the file in the same second, but after mdimport has imported, then all the file mod times check out, since they are only accurate to one second, and it is not imported again.

Or some variation on that. Perhaps setting no tags, then 0.3 seconds later setting real tags?

You can call mdimport on a file with an nstask to force it to rescan,

Just some ideas

Tom

Sent from my iPad

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

MacPrawn

unread,
Feb 2, 2011, 11:10:46 AM2/2/11
to OpenMeta
Thanks Tom - actually quite helpful... I'll try the delayed approach,
see if it helps or not... But your explanation makes sense: spawning a
new thread would porbably delay the code a bit, and that would explain
that...

Thanks!
Reply all
Reply to author
Forward
0 new messages