• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Insuring a path exists
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Insuring a path exists


  • Subject: Re: Insuring a path exists
  • From: Frank Fenn <email@hidden>
  • Date: Tue, 8 Jun 2004 21:25:33 -0600

On Jun 8, 2004, at 8:54 PM, Mike O'Connor wrote:

> NSString* thePath=@"/Library/Application
> Support/MyApp/MySubfolder/file.typ"
>
> I want to insure that folders MyApp and MySubfolder exist, so that
> when I do a writeToFile: using that path, it will succeed.

NSString *appsupp = [NSString stringWithString:@"/Library/Application
Support/App"];

// create application support directory

if(![[NSFileManager defaultManager] fileExistsAtPath:appsupp]) {

// do your stuff if directory doesn't exists

}

Sincerely,
Frank Fenn

--

Bright Light Software - http://www.brightlightsoftware.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.


References: 
 >Insuring a path exists (From: "Mike O'Connor" <email@hidden>)

  • Prev by Date: Re: Losing Focus
  • Next by Date: Re: Retain cycle problem with bindings & NSWindowController
  • Previous by thread: Insuring a path exists
  • Next by thread: Re: Insuring a path exists
  • Index(es):
    • Date
    • Thread