This is exactly what I need, but it's only available on 10.5 or later,
hence why I'm trying to put a simple equivalent together...
JNJ
On 13-Nov-08, at 1:21 PM, Quincey Morris wrote:
On Nov 13, 2008, at 10:11, Etienne Guérard wrote:
You might want to do it this way:
- (void)createDirectoryRecursivelyAtPath:(NSString *)path
{
//check if the dir just above exists...
NSFileManager *fileManager = [NSFileManager defaultManager];
BOOL isDir;
NSString *directoryAbove = [path stringByDeletingLastPathComponent];
if (![fileManager fileExistsAtPath:directoryAbove
isDirectory:&isDir]
&& isDir)
{
// call ourself with the directory above...
[self createDirectoryRecursivelyAtPath:directoryAbove];
}
// Now we enforced that the dir exist
// Fine, create the dir...
[fileManager createDirectoryAtPath:path attributes:nil];
}
Or even this way: [[NSFileManager defaultManger]
createDirectoryAtPath: path withIntermediateDirectories: YES
attributes: nil error: &error]?
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/silvertab%40videotron.ca
This email sent to [EMAIL PROTECTED]
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]