[comp.sys.mac.programmer] Finder Get Info comments

houch@cs.albany.edu (Joseph Houghtaling) (11/21/90)

I'm starting to write an application that will add Finder Get Info comments
to a number of files concurrently.  I've not found much documentation on how
the Finder stores such comments (actually I've found none), so I have a 
couple questions.

I'm discovered the 'FCMT' resource in the Desktop file on the current Finder.
The format of this resource seems pretty straightforward, so I probably 
wouldn't have any problem implementing my program using the resource-based
Desktop file (<--famous last words :-) )  I am using Desktop Manager
on my harddrive; how are comments stored there?

I am aware that System 7 will incorporate the functionality of Desktop Manager
into the Finder.  Might it provide some facility for doing the kind of
mass-commenting I want to implement in my program?  What kind of data struc-
ture will that Finder use to store comments?  Is there any new kind of Finder
file commenting being offered?

Finally:  Would this be Apple-kosher?  Is there documented anywhere a 
statement from Apple DTS or elsewhere saying, "Don't muck with the Desktop
File"?

I look forward to your comments and, as always, thank you for your support.

j.

-- 
| joe houghtaling        | "In my opinion television | computer science dept.|
| jh0576@leah.albany.edu |  validates existence."    | suny at albany        |
|                        |                -calvin    | albany, ny 12222 usa  |

francis@arthur.uchicago.edu (Francis Stracke) (11/22/90)

Related question: does Desktop Manager (BTW, just what exactly is it? :-)
keep your comments from going bye-bye when you rebuild the Desktop?
If not, will System 7?
| Francis Stracke		| My opinions are my own.  I don't steal them.|
| Department of Mathematics	|=============================================|
| University of Chicago		| Non sequiturs make me eat lampshades	      |
| francis@zaphod.uchicago.edu	|   				       	      |

oster@well.sf.ca.us (David Phillip Oster) (11/24/90)

I would be very surprised if the finder implemented the locking protocol
necessary to insure simultaneous update access to the desktop database.
Your best bet would be to see what appleEvents the Finder accepts, (documented
in Inside Mac Vol 6) and if there are not appleEvents to get and put the
finder info, petitioning Apple to add them pronto. Inside Mac Vol 6 may be
available from APDA, and all registered developers got a copy on the Big Bang
and Beta Bang System 7 CD-ROMs.

If you just write into the file while the Finder has it open, you will
make the structure the Finder has cached about the file into garbage, and
it will garbage the file the next time it writes.
-- 
-- David Phillip Oster - At least the government doesn't make death worse.
-- oster@well.sf.ca.us = {backbone}!well!oster

russotto@eng.umd.edu (Matthew T. Russotto) (11/25/90)

In article <21814@well.sf.ca.us> oster@well.sf.ca.us (David Phillip Oster) writes:
>I would be very surprised if the finder implemented the locking protocol
>necessary to insure simultaneous update access to the desktop database.
>Your best bet would be to see what appleEvents the Finder accepts, (documented
>in Inside Mac Vol 6) and if there are not appleEvents to get and put the
>finder info, petitioning Apple to add them pronto. Inside Mac Vol 6 may be
>available from APDA, and all registered developers got a copy on the Big Bang
>and Beta Bang System 7 CD-ROMs.

Huh?  The Finder calls the desktop manager routines documented (incorrectly)
in Inside Mac Volume 6.  If an application used the same routines, why
would there be a problem?

>If you just write into the file while the Finder has it open, you will
>make the structure the Finder has cached about the file into garbage, and
>it will garbage the file the next time it writes.
The caching is done by the Desktop Manager itself, not the Finder, or so it
appears from a little MacsBugging in Finder 6.07 with Desktop Manager 
running-- the finder caches the icon, etc, but the cache seems to be
invalidated on context switches anyway.  And this caching won't damage the
file, though I guess it is possible that it would wipe out your added comments.

--
Matthew T. Russotto	russotto@eng.umd.edu	russotto@wam.umd.edu
     .sig under construction, like the rest of this campus.