jenwrenfer has asked for the wisdom of the Perl Monks concerning the following question:

Anyone know of a perl module or quick and dirty way of pulling the inherit setting (either replace or propagate) off of a Windows file? I'm pulling the permissions right now using Win32::FileSecurity, but don't see any way of accessing that inherit setting. Thanks!

Replies are listed 'Best First'.
Re: Inherit File Setting
by BrowserUk (Patriarch) on Aug 04, 2004 at 18:40 UTC

    I think you may be out of luck trying to do this with Win32::FileSecurity as it doesn't appear to expose this part of the API.

    There is some code in the .xs file that related to the inheritance bits of the ACE, but it seems to be defined in terms of constants that are not exported.

    Actually, the related code is a little bizaar on first reading, and I don't understand what is going on in there.

    You could resort to doing with Win32::API, but going by xs code for W32::FS, that is distinctly non-trivial.

    The easy alternative would be to shell out to cacls.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon