Closed GoogleCodeExporter closed 8 years ago
The reason that no other utilities maintain Finder comments is, I think, the
fact that there is not any
documented API to modify them, as far as I know. It is simple enough to read
them by looking at
kMDItemFinderComment in the file metadata, but I have not found any way to
write this programatically as of
yet. There is a PBDTSetCommentAsync function in the Carbon File Manager API,
but it seems to only affect the
OS 9 comments stored in the Desktop database, which won't be visible in OS X.
Currently, the only way I know of to modify the Finder comments is to send an
AppleScript to the Finder.
However, this is really kludgey, and has a number of problems associated with
it (for example, what if the
Finder isn't running for some reason?).
I think the idea is that in OS X, Apple has decided that they want the comment
field to be something
exclusively owned by the user, and not for application developers to write to.
That's the only explanation I can
come up for this omission, at least.
Original comment by Charle...@gmail.com
on 14 Mar 2007 at 12:11
Well, one way is by copying the .DS_Store file, which xar seems to omit from
archives by default. At the very
least, it seems if you archive a whole folder, the .DS_Store should be
maintained unless explicitly omitted by
the operator.
Unfortunately, since The Finder maintains comments on copies, there's a
disconnect between the Finder's
behavior and darn near every command-line program's. It would be awful nice if
xar could handle that and
even open up Spotlight Comments to searching via the XML envelope. It would
CERTAINLY make xar stand out
from the pack.
I wonder if there's a way to parse the .DS_Store file?
Original comment by nik%inik...@gtempaccount.com
on 15 Mar 2007 at 5:14
The way that Finder comments are archived makes them unlikely to be archived by
xar in the near future. They
are not specifically "part of the file", they are part of a separate database
of files. Although Finder presents it as
an attribute of the file, it is no more a part of the file than information
about it you have stored in an Excel file
referencing it.
How are you trying to archive a .DS_Store that you are finding it omitted? I
find that odd that it is not being
included. If you are specifying something like xar -cvf foo.xar foo/*, the *
is interpreted by the shell and will not
match dot-files. However, if you're doing something like xar-cvf foo.xar foo/
and it is still not being archived,
I'd like to hear about that.
Original comment by bbraun
on 17 Apr 2007 at 2:19
Well, the fact they are not part of the file is sort of a historical issue. I'd
hope that they moved over to being
stored in an EA in a future release, but who knows if/when that will happen. It
is possible to get/set the
comments using AppleEvents.
Original comment by finlay.d...@gmail.com
on 25 Apr 2007 at 12:36
Closing.
Original comment by bbraun
on 24 Jul 2007 at 1:23
Original issue reported on code.google.com by
nik%inik...@gtempaccount.com
on 12 Mar 2007 at 10:08