We don't bite newbies here... much | |
PerlMonks |
Re: Re: Re: Setting permissions as text file is createdby coec (Chaplain) |
on Mar 17, 2004 at 13:32 UTC ( [id://337322]=note: print w/replies, xml ) | Need Help?? |
A couple of points: 1) chmod and the sysopen* call above set the file mode not the permission 2) A file mode of 0666 is generally bad as it is generally allows more access to the file than is needed (do you really want everyone to be able to read/change 3) If you need to modify owner or the group membership, use chown CC Updated: Ok, you can't actually delete the file unless you have write access to the directory whihch holds the file. You can, however, blank out the file. For example: will reduce the file to zero bytes without actually having write access to the directory. The file isn't deleted but it certainly isn't very useful now. * if your umask is sane (ie 022) then the sysopen (FILEHANDLE, ">>$filepath",O_CREAT, 0666) will not be inherently insecure.
In Section
Seekers of Perl Wisdom
|
|