Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Feb 2003
    Location
    California
    Posts
    925
    Thanks
    0
    Thanked 0 Times in 0 Posts

    traverse files and modify with C++

    I have a program I wrote that inputs a file and midifys it to a certain format. But is there a way to have the program traverse all the files of the specified type and change them? Can I have the files in folders under folders or do they have to be all in the same folder? Either way is fine for me.


    Jason

  • #2
    Regular Coder
    Join Date
    Dec 2003
    Posts
    367
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Of course you can.
    How to do it depends on the platform you're developing for, but any platform must have a way to get directory listings, and then it's just a matter of you writing some code that parses the filenames you get and test the extension, and recursesively searches through subdirectories.

    shmoove


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •