• 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 16:19:36 -0500

Putting the files into a different directory won't help unless the directory varies with the user.  It needs to be each user's home directory, not "a" home directory.  Something like this:

property in: POSIX path of (path to home folder) & "in.txt"
property out: POSIX path of (path to home folder) & "out.txt"

On Wed, Feb 9, 2011 at 4:04 PM, Hudson Barton <email@hidden> wrote:
I put real files into a home directory where permissions are known.  The problem with the secondary users did not go away... because the permissions problem is not with the files but rather with the POSIX files.  

As for your other suggestion, the purpose here is encryption using a shell script and it apparently requires the files (whether temporary or real) to be named "in" and "out" for some reason.  I have not figured out a way around it.

Are you saying that this script will run on another computer even though it will not run on the different user of the same computer?

Is there any way that I can change the ownership of the POSIX files?


On Feb 9, 2011, at 12:13 PM, Mark J. Reed wrote:

/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>





--
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

References: 
 >POSIX file permissions (From: Hudson Barton <email@hidden>)
 >Re: POSIX file permissions (From: "Mark J. Reed" <email@hidden>)
 >Re: POSIX file permissions (From: Hudson Barton <email@hidden>)

  • Prev by Date: Re: POSIX file permissions
  • Next by Date: Append QT movies without adding tracks
  • Previous by thread: Re: POSIX file permissions
  • Next by thread: Re: POSIX file permissions
  • Index(es):
    • Date
    • Thread