• 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: FW: NSFileManager
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FW: NSFileManager


  • Subject: Re: FW: NSFileManager
  • From: Jonathan Stimmel <email@hidden>
  • Date: Sun, 24 Jun 2001 13:47:50 -0700
  • Mail-followup-to: Jonathan Stimmel <email@hidden>, Cocoa-Dev <email@hidden>

On Sun, Jun 24, 2001 at 01:10:36PM -0700, Tommy Braas wrote:

> Although it might not be a programmatic but it is definitely a documentation bug. I think it should clearly state under which circumstances [ NSFileManager currentDirectoryPath ] returns what.
>
> Am I the only one that thinks that?

How would you clarify this method? The method itself doesn't set the
current working directory, it's inherited from the process/application
that launched your application. You could document the finder's behavior,
but what if your program is launched from another location? What if the
finder's behavior changes in a future release (not likely, admittedly)?
What if (as already pointed out) someone starts your app from the command
line, where the cwd could be anywhere on the filesystem? Yes, I have
done the last one, though I don't make a habit of it...

The basic rules I follow when writing shell scripts (same applies to apps):
- don't make any assumptions about what it will be at startup (unless
you've clearly documented your program's requirements to the user)
- if you care about the cwd, check and/or set it yourself


References: 
 >RE: FW: NSFileManager (From: Fritz Anderson <email@hidden>)
 >RE: FW: NSFileManager (From: "Tommy Braas" <email@hidden>)

  • Prev by Date: two quick questions: keychain and events
  • Next by Date: Compositing two NSImages
  • Previous by thread: RE: FW: NSFileManager
  • Next by thread: Re: FW: NSFileManager
  • Index(es):
    • Date
    • Thread