So often your question has the answer :-)....naturally after some more thought I checked to see if perl had a builtin for chmod, and to little surprise it did. So I am now using perl's builtin chmod and things are happy again, however, I am still curious about open's ability to do this rather than requiring a separate function, so can it?
Anyone hiring? http://danconia.org Wiggins d'Anconia wrote: > Couple questions about the default setting of permissions on files > written with "open".... > > Background: > I have a long time running cgi script that takes multipart uploads of > files and stores them to the local server. Below is *almost* the exact > code I have written (post input checking, permission checking, etc.): > > # write the file > open(WRITEFILE,">$filename"); > print WRITEFILE $CGI{'scriptfile'}->{'Contents'}; > close(WRITEFILE); > > Recently (in the last week or so) my hosting provider has made some > change so that scripts written by the web server through this script are > now stored as 640 instead of the previously 644: > > Example: > -rw-r----- 1 scripts scriptsg 137k Jul 10 11:31 11109-0.scw > -rw-r--r-- 1 scripts scriptsg 155k Jul 2 20:57 7694-0.scw > > Which prevents the re-download of the files from the client (permission > error). > > Questions: > 1) How can I set the default permissions on the file that is written to > what I *need* (less secure I realize, but necessary), aka the original > default of 644? (I realize I could then use a system call and chmod the > file but I would really rather not.) > > 2) How has my ISP set this new restriction to the default for writes on > a script that they haven't edited (at least they better not have)? > > If necessary: > Linux .com 2.4.15-pre8 #1 Wed Nov 21 13:16:53 CST 2001 i686 unknown > This is perl, v5.6.0 built for i686-linux > > Thanks.... > > Anyone hiring? > http://danconia.org > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]