Re: POSIX file permissions
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