I don't see the value in guessing before-hand whether unlink will fail vs. just doing the normal:

unlink( $file ) or die "Can't delete $file: $!\n";
There are a lot of things that can make unlink fail.

Did you actually find that "delete files within the folder" was disabled and enabling it fixed the problem? Because my first guess in that situation would be that you still have the file open and the default sharing mode don't allow deleting of open files. See the Win32API::File documentation for more information on Win32 file sharing modes.

Oh, and sorry, no, I don't know of any great Perl modules for dealing with Win32 security. There is a module called Win32::Perm or Win32::Perms or something that will never be on CPAN and that does way too much meddling with the data for my tastes so I don't know much about it, but you might search for that one and see if it does more of what you are looking for.

                - tye

In reply to Re: win32::filesecurity -- outdated? (why?) by tye
in thread win32::filesecurity -- outdated? by blahblahblah

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.