Thread: messing with the file system

  1. #1
    Registered User stormbringer's Avatar
    Join Date
    Jul 2002
    Posts
    90

    messing with the file system

    i am curently working on a console app under windows. now it should search for a specific file type (i.e. *.txt or da*.txt) from any subdirectory which is specifyed (ie c:\tmp) and in it's subfolders (like dir /s /b). how can i do that. is there a tutorial on working with the fat filesystem?

    thanks

    stormbringer

  2. #2
    Im back! shaik786's Avatar
    Join Date
    Jun 2002
    Location
    Bangalore, India
    Posts
    345
    Why do you need to work with FAT for that? What compiler are you using, each compiler has it's own set of function libraries for directory navigation. Check your compiler's documentation for that.

  3. #3
    Registered User stormbringer's Avatar
    Join Date
    Jul 2002
    Posts
    90
    my programm needs to collect all files *.txt in all subfolders from the curent list and scan them for a keyword. after completition it shall store all filenames and paths where the keyword is found in a .txt file.
    i'm using lcc and i'll check that documentation.

    thks

    stormbringer

    p.s: why is browsing folders compilerspecific and working on files not?

  4. #4
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    >why is browsing folders compilerspecific and working on files not?
    Not every OS has "directories", and even then, the interface to each type of directory can be different.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  5. #5
    Registered User stormbringer's Avatar
    Join Date
    Jul 2002
    Posts
    90
    even then it shouldn't be compilerspecific, more "libraryspecific". am i wrong?

  6. #6
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Originally posted by stormbringer
    even then it shouldn't be compilerspecific, more "libraryspecific". am i wrong?
    Isn't that the same thing? With your compiler, you (might) get a library that is for directory manipulation.

    The C standard is designed to be generic in this area, providing only basic file access.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  7. #7
    Registered User stormbringer's Avatar
    Join Date
    Jul 2002
    Posts
    90
    so, just because i'm wondering: could you build all the filefunctions like searching and so on from the ground up with just using c? i know you can when using asm.

    if yes, do you know where i could get a tutorial on that?

    stormbringer

  8. #8
    Me want cookie! Monster's Avatar
    Join Date
    Dec 2001
    Posts
    680
    Originally posted by Hammer

    Isn't that the same thing? With your compiler, you (might) get a library that is for directory manipulation.

    The C standard is designed to be generic in this area, providing only basic file access.
    Or you get the library with the OS. So it's not the same thing.
    For example the FindFirstFile function is OS specific, not compiler specific.

  9. #9
    Registered User stormbringer's Avatar
    Join Date
    Jul 2002
    Posts
    90
    so is there a windows specific function for browsing directorys? do you have a link to a tutorial?

  10. #10
    Me want cookie! Monster's Avatar
    Join Date
    Dec 2001
    Posts
    680

  11. #11
    Registered User stormbringer's Avatar
    Join Date
    Jul 2002
    Posts
    90
    thanks, i'll check that.$

    stormbringer

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem building Quake source
    By Silvercord in forum Game Programming
    Replies: 16
    Last Post: 07-11-2010, 09:13 AM
  2. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 04:14 AM
  3. Basic text file encoder
    By Abda92 in forum C Programming
    Replies: 15
    Last Post: 05-22-2007, 01:19 PM
  4. Simple File encryption
    By caroundw5h in forum C Programming
    Replies: 2
    Last Post: 10-13-2004, 10:51 PM
  5. Replies: 4
    Last Post: 10-21-2003, 04:28 PM