Re: Where/how to store lots of user application data
Re: Where/how to store lots of user application data
- Subject: Re: Where/how to store lots of user application data
- From: John Stiles <email@hidden>
- Date: Fri, 13 May 2005 11:26:53 -0700
Actually, that's not quite correct. Hard-coding the names "Library"
and "Application Support" is really bad form. There is a FSFindFolder
API which is meant to locate that folder for you. (Nowadays there
might even be a Cocoa API for it... it's about time...)
On May 13, 2005, at 11:27 AM, Bruce Truax wrote:
Graham,
This should work.
NSFileManager *fileManager = [NSFileManager defaultManager];
aPath = [[NSString alloc] initWithFormat:@"~/Library/Application
Support/yourApp"];
BOOL pathExists;
[fileManager fileExistsAtPath:[aPath stringByExpandingTildeInPath]
isDirectory:&pathExists];
if (!pathExists){
[fileManager createDirectoryAtPath:[aliasPath
stringByExpandingTildeInPath]
attributes:nil];
[aPath release];
}
--
____________________________________________________________
Bruce E. Truax email: email@hidden
Optical Engineering Consultant
Diffraction Limited Design LLC
388 Wedgewood Road voice: 860-276-0450
Southington, CT 06489 fax: 860-620-9026
http://www.dld-llc.com
_____________________________________________________________
From: Graham <email@hidden>
Date: Fri, 13 May 2005 14:15:30 -0400
To: Cocoa List <email@hidden>
Subject: Re: Where/how to store lots of user application data
Thanks for all the advice on the location, now I am embarrassed to
admit I cannot determine how to create a directory.
I am able to write my data easily using the NSFileWrapper class to an
existing directory, but I cannot work out how to make a directory
using the Cocoa API's?
I am using Java by the way.
Thanks
Graham
On May 13, 2005, at 1:51 PM, John Stiles wrote:
On May 13, 2005, at 10:47 AM, Ricky Sharp wrote:
Definitely. Or, use a folder hierarchy (this is what I do for all
my products). For example:
+ Application Support
+ My Company
+ My Product Family
+ My Product
* all support files
The reason I went the folder route was that it was easier for the
user to find it. Furthermore, it made integration with .mac
syncing a snap; I just had to specify the root "My Company" folder.
Agreed. I know it's still the offically recommended way, but in my
years of OS X usage I have yet to warm up to com.company.product
style filenames. If nothing else, it makes it next to impossible to
use type selection in the Finder.
I wish they would revisit that decision for OS X 10.5. Folder
hierarchies would be fine with me. Then again, I honestly cannot
remember one instance where two OS 9 programs tried to take the
same preference file name. It just didn't happen in practice.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gragsie.com
This email sent to 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:
40cox.net
This email sent to 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:
40blizzard.com
This email sent to 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