Re: Directory info?
- Posted by euphoric (admin) Sep 21, 2008
- 1053 views
DonCCole said...
I thought of that but how would retrieve the data? Say into a .dat file.
In your program do
system( "dir > myfile.txt", 2 )Then open that file and parse the line with "Dir(s)" on it for the "bytes free" info.
Here's a sample of what you'll get in myfile.txt:
C:\Documents and Settings\HP_Administrator>dir Volume in drive C is HP_PAVLON Volume Serial Number is CD14-1DE0 Directory of C:\Documents and Settings\HP_Administrator 09/20/2008 12:34 AM <DIR> . 09/20/2008 12:34 AM <DIR> .. 09/20/2008 10:27 PM <DIR> Desktop 06/08/2008 09:28 PM 199 ex.err 03/01/2008 08:21 PM <DIR> Favorites 09/02/2008 05:45 PM <DIR> My Documents 03/01/2008 06:50 PM <DIR> Start Menu 03/08/2008 06:54 PM <DIR> Temp 05/25/2006 04:56 PM <DIR> WINDOWS 2 File(s) 60,943 bytes 11 Dir(s) 182,539,636,736 bytes free