PDA

View Full Version : retrieving drive directories and files



PURE_POWER
05-23-2003, 10:28 PM
hi,

Im making a DOS versoin of Windows Explorer in C++, and need to know how to-
Scan for current Drives including A:\ and CD and get Info
Get directories and files

In qbasic i used SYSTEm("dir *.* > dir.tem") to redirect a DOS dir command to a file, and my program opened the file and read it in. Sadly tho i dont know how to make a system call in C++ (if its possible) or if this is the best way of going about it.
Any help would be cool
PLEASE email me Carrizzma_nz@yahoo.com
thx.

WaltP
05-24-2003, 12:40 AM
Different compilers have different functions -- which compiler are you using?

Shadow
06-01-2003, 02:01 PM
> Get directories and files
system("C:");
system("cd\");
system("attrib /s >HardDrive.txt");

HardDrive.txt contains your entire hard drive, all files(hidden, read-only, system, etc.), and the full path to them.

The text file is 1.90mb on my machine.