Re: Newbie: Current Apps Directory
Re: Newbie: Current Apps Directory
- Subject: Re: Newbie: Current Apps Directory
- From: Andres Ramirez <email@hidden>
- Date: Wed, 16 Apr 2003 00:23:23 -0400
Unfortunately, doing this is sometimes quite useful, specially in
production pipelines where you just want to set something up that
behaves like droplets. It's nice to be able to simply add templates
into a folder and then be able to do large batch operations. It's also
nice to be able to have different versions of these dependent on
project or clients without having to be endlessly selecting preferences
and the sort. This is probably not the way to go if you are trying to
make something for commercial development, but it is very valid in a
productions environment, so don't dismiss it completely.
- Andres
On Tuesday, April 15, 2003, at 07:53 PM, publiclook wrote:
Please don't make applications that do this sort of thing. Just put
the data file in the application bundle and access it via NSBundle's
-pathForResource:ofType: or put the data file in a
~/Libary/ApplicationSupport directory. Don't search the entire
Applications directory or clutter file systems with random data files.
This is just my opinion, and I don't mean to be insulting. I am just
expressing my (and I think Apple's) wishes.
On Tuesday, April 15, 2003, at 04:40 PM, Craig Bakalian wrote:
On Tuesday, April 15, 2003, at 03:31 PM,
email@hidden wrote:
I'm doing a quick little drag and drop utility that has template
files
next to it that I need to read. I have things set up to be flexible
enough to change which template files to use, but as a default, I
would
like it to read the ones that are right next to it. ( html files )
( worst comes to worst I'll set it up in a preference, and have to
set
it up the first time I use it, but I'd rather not do anything extra,
since one can easily change it if the initial suggestion is not good
)
-- which in my case it is.
Hi,
I had the same problem a day ago. This was the solution ->
-(void) someFunction
{
NSString *file;
NSFileManager *fileManager = [NSFileManager defaultManager];
NSDirectoryEnumerator *enumerator;
NSString *bun = [[NSBundle mainBundle] bundlePath];
NSString *p = [bun stringByAppendingPathComponent: @"/.."];
if([fileManager changeCurrentDirectoryPath: p])
{
enumerator = [fileManager enumeratorAtPath: [fileManager
currentDirectoryPath]];
while(nil != (file = [enumerator nextObject]))
{
}
}
}
The [[NSBundle mainBundle] bundlePath] gets the apps bundle path, the
@"/.." shoots the directory up.
The enumerator just chugs through all in the directory. You just need
to set the currentDirectoryPath before you use it. The name
currentDirectoryPath is misleading.
Craig Bakalian
www.eThinkingCap.com
_______________________________________________
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.
Andres Ramirez
Motion Graphics and Animation
http://www.pixeldream.com
617-413-8582
_______________________________________________
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.