Link to home
Start Free TrialLog in
Avatar of prashanthgn
prashanthgn

asked on

WIN32 API function to get Disk free space..

Hi,

  Any way of finding free disk space in pel WIN32 API..???

-Prash
Avatar of jt401
jt401

you can use Win32::DriveInfo  -

use Win32::DriveInfo;

$TotalNumberOfFreeBytes = (Win32::DriveInfo::DriveSpace('c:'))[6];
Avatar of prashanthgn

ASKER

Thanx for the help,

I have 2 more questions,

1.
How to get the number of files and dirs (including files and dirs in the sub dirs).
I tried to use

      use File::Find;
               find(\&Getfiles, "c:\\temp");
               sub Getfiles {
                       ### count files and dirs here....
      }

But this takes a lot of time if the dir contains more number of files ....

Is there any of finding it more quickly....

2.
Is there any function to check if any specified extension  file exists in a dir..??


Thanx in advance
ASKER CERTIFIED SOLUTION
Avatar of jt401
jt401

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Nothing has happened on this question in more than 8 weeks. It's time for cleanup!

My recommendation, which I will post in the Cleanup topic area, is to
accept answer by jt401.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer