in reply to Finding Drive usage info with Win32

Unfortunately, Win32::AdminMisc isn't on CPAN so I'm not going to go googling in hopes of find it and documentation for it. But there is a reasonable chance that if the call fails, then you can look at $^E to get an explanation as to why it failed. If that doesn't work, then see the module's documentation for how you are supposed to get the failure reason.

Note that \\server won't have a 'c' shared drive unless you shared it, but will have a 'c$' automatically, though only accessible to administrators. So one possiblity is that you dropped the '$', though that is, of course, just a guess on my part.

- tye        

  • Comment on Re: Finding Drive usage info with Win32 ($^E?)

Replies are listed 'Best First'.
Re^2: Finding Drive usage info with Win32 (Win32::AdminMisc)
by bobf (Monsignor) on May 17, 2006 at 04:44 UTC

    I found Win32::AdminMisc on the Roth Consulting site. The Win32::AdminMisc FAQ, which appears to also contain the documentation, provides a link to the ftp site that can be used to download the latest version of the module (currently 20030714). This module is available from the Roth PPM repository (http://www.roth.net/perl/packages/).

    According to the FAQ, the GetDriveSpace function returns nothing if the call was unsuccessful, or the total drive capacity and the available space on the drive if the call was successful.

    A list of Roth Consulting's Perl Extensions is available at http://www.roth.net/perl/#Installation.

    Update: This post was in response to tye's "Unfortunately, Win32::AdminMisc isn't on CPAN so I'm not going to go googling in hopes of find it and documentation for it" rather than his comment regarding the reason of failure. I just thought quick access to the links above would be useful in future searches. For the record, I didn't see anything in the docs about failure reasons and I didn't examine the code.

      Note that this didn't answer the question I had about the module. I already knew that "nothing" was returned for failure. What would be nice to know, is how to get the failure reason. This is often hard to find in the documentation so I often just look at the source... which is conveniently made available by http://search.cpan.org/... except that this module isn't on CPAN and I suspect the author doesn't make the source available anywhere else (this is certainly the case for some modules from this author). So the next step might be "try it and see" if $^E works for that, but I avoid installing non-CPAN modules so I won't (the original problem was solved anyway).

      - tye        

Re^2: Finding Drive usage info with Win32 ($^E?)
by TeraMarv (Beadle) on May 17, 2006 at 04:34 UTC
    Tye,

    You are right! I have added the '$' and it works now.
    I am part of the adminstrators group so access is not a problem.

    Thanks.