Re: How to do "mkdir -p"?
Re: How to do "mkdir -p"?
- Subject: Re: How to do "mkdir -p"?
- From: Graeme Hiebert <email@hidden>
- Date: Fri, 12 Apr 2002 22:06:02 -0700
On Friday, April 12, 2002, at 07:36 PM, Andy Lee wrote:
It seemed odd to me that [NSFileManager
-createDirectoryAtPath:attributes:] requires the parent directory to
exist, because how hard could it be to create intermediate directories
if "mkdir -p" does it? I wondered if there was some filesystem
subtlety I wasn't grasping, but even if there is, I should be able to
use mkdir itself, as you say.
What happens if it could make some of the necessary directories, but not
all of them? Should it leave the litter behind, or remove the
intermediate directories? Probably the latter, but it will still muck
with the modification time of the last "pre-existing" directory. In
either case, I'm not sure if I'm comfortable with a simple utility
method call making some sort of changes but telling me it couldn't do
anything.
Anyway, something like this would be pretty easy to implement with a
simple category on NSFileManager.
-g
_______________________________________________
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.