Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

File::Temp permisions?

by Anonymous Monk
on Feb 09, 2006 at 22:46 UTC ( #529221=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm confused again.

I'm using File::Temp in a CGI program on apache/LINUX. The temp files get created just fine but I need to access them later in the program with another program called with system(). Problem is the permissions are 600 and the owner is 'nobody'.

  • Who is the user when running system?
  • Can I change/set the permisions using File::Temp?
  • What happens later when I port this to Windows?

I guess what I'm asking is what is the best way to deal with this to be portable? I soppose I could use chmod() but what will windows think?

Replies are listed 'Best First'.
Re: File::Temp permisions?
by misterb101 (Sexton) on Feb 10, 2006 at 11:14 UTC
    Hi anonymous, the owner of new files created by an cgi process is the user that is running apache. usually this is www-data, apache or just nobody.
    I don't think File::Temp offers setting of file permissions but you can do this by either.
    - chmod 0755 ,$file;
    - changing apache config to set the file create mask to 755 or whatever you like

    In windows I don't know what would happen since I never work on windows systems anymore ;)

    Cheers,
    Rob
Re: File::Temp permisions?
by MCS (Monk) on Feb 10, 2006 at 14:52 UTC

    I don't really do windows much anymore but file permissions are a bit lax on windows so I don't think it should be a problem. If I remember correctly, chmod() is ignored on windows.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://529221]
Approved by Old_Gray_Bear
Front-paged by planetscape
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2023-05-28 19:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?