• 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: POSIX file permissions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: POSIX file permissions


  • Subject: Re: POSIX file permissions
  • From: "Mark J. Reed" <email@hidden>
  • Date: Wed, 9 Feb 2011 12:13:48 -0500

/tmp is a global location.  Once the first user creates the files there, that user owns those files, and only that user can write to them.  So when the second user tries, it doesn't work.

If you have multiple users that need to run this, you could put the files in their home directories instead of /tmp and/or include something to make the filenames different - include the username or a timestamp or a process id or something.

On Wed, Feb 9, 2011 at 11:45 AM, Hudson Barton <email@hidden> wrote:
I have the following script:

property fin : "/private/tmp/in.txt"
property fout : "/private/tmp/out.txt"
property finmac : POSIX file fin
property foutmac : POSIX file out

dostuff("blah blah blah", fin, fout, finmac, foutmac)

on dostuff(sometext, fin, fout, finmac, foutmac)
       open for access finmac with write permission
       set eof finmac to 0
       write (sometext as string) to finmac
       close access finmac
end dostuff

The script runs fine on one user, but when I move it to any other user, it produces the error "Network file permission error." number -5000 from file "Macintosh HD:private:tmp:in.txt"  at open for access finmac.

What's going on?  I don't understand permissions on POSIX files, or more especially how to fix it.

H.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden



--
Mark J. Reed <email@hidden>

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: POSIX file permissions
      • From: Hudson Barton <email@hidden>
References: 
 >POSIX file permissions (From: Hudson Barton <email@hidden>)

  • Prev by Date: Address Book Plug-in stopped working
  • Next by Date: Re: POSIX file permissions
  • Previous by thread: POSIX file permissions
  • Next by thread: Re: POSIX file permissions
  • Index(es):
    • Date
    • Thread