Re: Tracking files the right way
Re: Tracking files the right way
- Subject: Re: Tracking files the right way
- From: Rosyna <email@hidden>
- Date: Fri, 30 Aug 2002 15:34:11 -0700
Ack, at 8/30/02, Bill Bumgarner said:
The behavior I have experienced-- on OS 9 and prior, not just OS X--
was for the applications to merrily open and edit the document in
the trash with zero warning to the user.
Except when the file is double-clicked in the finder and it was in the trash ;)
Ahh... code examples, now we are back on track and moving away from
bordering dangerously close to flogging a dead horse (not an
accusation-- I clearly have my cat-o-nine tails in hand). :-)
The foundation offers:
- (NSString *)stringByStandardizingPath
- (NSString *)stringByAbbreviatingWithTildeInPath
The second does the obvious -- substitute '~/' with '~user/' if you
want user A to be able to pass a path in their home directory to
user B. The first performs a number of operations on the path.
Notably, it ensures a path does not refer to /private/ if that part
of the path can be removed while the path will still point to the
same file.
Unfortunately, -stringByStandardizingPath will also cause symlinks
to be expanded -- not necessarily what you want.
In what *exact* cases have you seen the private directory?
I'll file a request via bugreport.apple.com.
If anything, this discussion should result in a lot of trips there ;)
In general, this is a really good idea for any developer writing an
app that involves some kind of a directory full of resources that
isn't managed with NSFileWrapper or NSBundle. Store as much
information using relative paths as you possibly can and automate
the identification of files as much as possible.
Right, and I think you can store two Aliases to do this, one relative
(for the files) and one absolute (for the parents). FSSpecs did this
actually. Then resolve the new alias, and base all the other aliases
on that path.
--
Sincerely,
Rosyna Keller
Technical Support/Holy Knight/Always needs a hug
Unsanity: Unsane Tools for Insanely Great People
---
Please include any previous correspondence in replies, it helps me
remember what we were talking about. Thanks.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.