• 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: Why root?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why root?


  • Subject: Re: Why root?
  • From: Christopher Nebel <email@hidden>
  • Date: Fri, 2 Aug 2002 12:41:58 -0700

On Friday, August 2, 2002, at 08:17 AM, John Delacour wrote:

Why does this script list the root instead of the user directory...

do shell script "ls -l"

and require us to to "cd ; ls -l" ?

The Terminal takes you to the user directory without any coercion. So does BBEdit. What happens if a user has no access permission to the root?

Because "do shell script", or rather the "sh" process that it invokes, inherits the working directory of its parent, and the Finder launches everything with a working directory of "/". If a user didn't have read permission for /, they'd get an empty result, because "ls" returns 0 even if it failed with EPERM. An admin would have to muck with that, though -- / is readable by everyone by default.

(What do you mean "BBEdit takes you to the user directory"? How can you tell?)


--Chris Nebel
AppleScript Engineering
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Replying to the list in Eudora
      • From: John Delacour <email@hidden>
    • Re: Why root?
      • From: John Delacour <email@hidden>
    • Re: Why root?
      • From: garbanzito <email@hidden>
References: 
 >Why root? (From: John Delacour <email@hidden>)

  • Prev by Date: Re: Move a sound file
  • Next by Date: Re: Why root?
  • Previous by thread: Re: Why root?
  • Next by thread: Re: Why root?
  • Index(es):
    • Date
    • Thread