Re: Add metadata to my files for Spotlight
Re: Add metadata to my files for Spotlight
- Subject: Re: Add metadata to my files for Spotlight
- From: Lorenzo <email@hidden>
- Date: Wed, 11 May 2005 13:33:47 +0200
Ok, thank you,
I will use dictionaryWithContentsOfFile and not use the pool.
More than this I have thought over other implications of Spotlight.
Since the indexing occurs at any time a file is created or copied or
duplicated, I think about what could happen during a backup.
If spotlight creates an index at any file-copy and the importer reads the
whole file with dictionaryWithContentsOfFile, in case of large files this
should slow down the backup time dramatically...
I supposed that, in case of file-copy or file-duplication, Spotlight simply
duplicates the metadata record without reading again the whole file, but I
have put a log line in my importer and the Console tool reports that log
line all the time, even in case of file-duplication by Finder, with the
pathname of the new file just created.
I would like to know, when does the indexing begin exactly?
When an application calls "noteFileSystemChanged:"?
Actually I have found only few importers in the Spotlight folder, and as I
have read in this list, Apple is using a good way to add metadata to its own
files made with iPhoto, iTunes... So no problem today. But, think about,
when the plug-ins will be thousands, reading the whole file all the time, a
backup could even take a double time.
I think that there should be a standard way to add metadata to the files,
because this affects the performance of the file system.
It should be cool to have a Cocoa API like
- (BOOL)addMetadata:(NSDictionary*)aDict toFile:(NSString*)pathname
and an API which gets the metadata dictionary from a file "without" reading
the whole file like
- (NSDictionary*)getMetadataFromFile:pathname
Last, maybe in the future, spotlight could avoid to read again the file in
order to build the index in case of file-copy or file-duplication. It could
simpler duplicate the index record and join the new record to the new
pathname.
I hope my argumentation is useful.
Best Regards
--
Lorenzo
email: email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden