I traced an error last week down to an unlink that was failing since the script didn't have permission to delete a file. This surprised me, since the file had just been created by that same instance of that same script. It turned out there's a Security property that you can set on directories in windows 2000 to allow or disallow deletion of files in that directory.
So I thought I'd add some error checking into my script, and I found the Win32::FileSecurity module. It has a method, EnumerateRights, that shows all the security rights for a file/directory. It seems like exactly what I want, except that it doesn't show the "delete files within the folder" property that I'm looking for.
The property, on windows 2000, can be viewed by right-clicking the file, choosing Properties, clicking the Security tab, clicking Advanced, then clicking the View/Edit button. My guess is that the list of properties you see on this screen was expanded in windows 2000 and that win32::FileSecurity hasn't been updated since NT 4.
Does anyone know of another module or way to get at that property easily through perl? I found
this page
on microsoft's site that looks like what I need, but I'm not sure how I could use it from perl. Since some of win32::FileSecurity's constants match those listed on this microsoft page, I'm wondering if there's a way to peek at win32::FileSecurity's data and manually check for the other properties.
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.