retrieving drive directories and files

This is a discussion on retrieving drive directories and files within the A Brief History of Cprogramming.com forums, part of the Community Boards category; hi, Im making a DOS versoin of Windows Explorer in C++, and need to know how to- Scan for current ...

  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 Carrizzma_nz@yahoo.com
    thx.

  2. #2
    Been here, done that.
    Join Date
    May 2003
    Posts
    1,156
    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, 04:10 PM
  3. problem while opening files from multiple directories
    By V.G in forum Windows Programming
    Replies: 2
    Last Post: 11-08-2004, 02:29 PM
  4. listing files in directories portably
    By ab384 in forum C Programming
    Replies: 2
    Last Post: 11-03-2004, 09:50 AM
  5. Replies: 4
    Last Post: 06-11-2004, 06:18 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21