Thread: searching for binery files

  1. #1
    Registered User
    Join Date
    Aug 2002
    Posts
    109

    searching for binery files

    I'm createing an address book and the user can save each book as a binery file with a .dg extension.

    Is there a way to search for all the *.dg files in the same folder as the application then print a list of all the files to the screen so the user can see what address books he/she has before opening one.

    Thanks
    OS:- XP
    Compiler:- MSVC++ 6 or DJGPP or Dev-c++ (Mingw)

  2. #2
    Registered User
    Join Date
    Oct 2001
    Posts
    66
    I'm createing an address book and the user can save each book as a binery file with a .dg extension.

    Is there a way to search for all the *.dg files in the same folder as the application then print a list of all the files to the screen so the user can see what address books he/she has before opening one.

    Thanks

    As they create each file could you not concatenate the name of the file to an index file and then search through that i.e.

    index file :-

    file.1dg
    file2.dg
    file3.dg
    file4.dg
    the newly created file would be appended here
    and so on
    T

  3. #3
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    This is OS dependant.... try looking up FindFirstFile (under win32). etc.

    Also, have a look round these boards. I know this has been asked before, and I also know some has posted some directory walking code too.

    [edit]
    Here's one that may help
    http://www.cprogramming.com/cboard/s...ghlight=walker
    Last edited by Hammer; 09-11-2002 at 05:48 PM.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Doxygen failing
    By Elysia in forum A Brief History of Cprogramming.com
    Replies: 19
    Last Post: 04-16-2008, 01:24 PM
  2. Multiple Cpp Files
    By w4ck0z in forum C++ Programming
    Replies: 5
    Last Post: 11-14-2005, 02:41 PM
  3. Folding@Home Cboard team?
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 398
    Last Post: 10-11-2005, 08:44 AM
  4. Searching txt files (another file i/o qn)
    By Catif in forum C++ Programming
    Replies: 9
    Last Post: 05-13-2002, 04:14 PM
  5. displaying text files, wierd thing :(
    By Gades in forum C Programming
    Replies: 2
    Last Post: 11-20-2001, 05:18 PM