Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] Computing free and used space in Windows

Expand Messages
  • Jenda Krynicky
    From: Ashish Gupta ... use Win32::FileOp qw(GetDiskFreeSpace); $freeSpaceForUser = GetDiskFreeSpace C: ; # or
    Message 1 of 5 , Jan 3, 2006
    • 0 Attachment
      From: Ashish Gupta <ashish_gupta_cal@...>
      > Hi,
      > I am writing a Perl script for capacity planning for Windows. I
      > am supposed to find free space and used space for C drive. I
      > tried using File:Find and also wrote my own recursive method for
      > finding total size of the c: drive. But it takes a long time to
      > compute. Is there any quick way to compute the total and free
      > size of C drive?
      > It would be very helpful if someone could give any pointer in
      > this regards.
      >
      > Thanks for attention
      > Ashish

      use Win32::FileOp qw(GetDiskFreeSpace);

      $freeSpaceForUser = GetDiskFreeSpace 'C:';
      # or
      ($freeSpaceForUser,$totalSize,$totalFreeSpace)=GetDiskFreeSpace 'C:';


      You can get Win32::FileOp from CPAN or via PPM.

      Jenda
      ===== Jenda@... === http://Jenda.Krynicky.cz =====
      When it comes to wine, women and song, wizards are allowed
      to get drunk and croon as much as they like.
      -- Terry Pratchett in Sourcery
    Your message has been successfully submitted and would be delivered to recipients shortly.