Thread: retrieving drive directories and files

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    4

    Post retrieving drive directories and files

    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 [email protected]
    thx.

  2. #2
    Been here, done that.
    Join Date
    May 2003
    Posts
    1,164
    Different compilers have different functions -- which compiler are you using?
    Definition: Politics -- Latin, from
    poly meaning many and
    tics meaning blood sucking parasites
    -- Tom Smothers

  3. #3
    Unleashed
    Join Date
    Sep 2001
    Posts
    1,765
    > 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.
    Last edited by Shadow; 06-01-2003 at 02:03 PM.
    The world is waiting. I must leave you now.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Creating and deleting directories and deleting files
    By fguy817817 in forum C Programming
    Replies: 1
    Last Post: 04-08-2009, 07:26 AM
  2. Directories and files using dirent.h
    By totalnewbie in forum C Programming
    Replies: 6
    Last Post: 11-19-2008, 05:10 PM
  3. problem while opening files from multiple directories
    By V.G in forum Windows Programming
    Replies: 2
    Last Post: 11-08-2004, 03:29 PM
  4. listing files in directories portably
    By ab384 in forum C Programming
    Replies: 2
    Last Post: 11-03-2004, 10:50 AM
  5. Replies: 4
    Last Post: 06-11-2004, 06:18 PM