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
/delete your file?)
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:
> my.file
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.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.