I am trying to search for files in Directories.
like, i have 10 directories..... and consider directory 1, which has 2 files..
this is same with all the files...
i want to get a string from each of these files from 10 directories... to be written to a seperate file, in C++.
I have been trying to do this.... any help will be greatly appreciated.
Thank you
Can you get a string from one file? If so then can you get a string from more than one file in the same directory? Do you have to search for the files according to some pattern, or do you have a list of filenames? I see this question a lot, and nobody gives enough detail. I need to know what you already know how to do. If you don't know how to open and read a file then my answering the question assuming your problem is with reading from multiple directories wouldn't help much. If you don't know how to open and read from different directories then I need to know what operating system and compiler you use because there's no portable solution for that problem.
Yes, i can get the string i want from one file, and from multiple files in one directory.
i have to search for the files, based on one String, and then get the data from those files.
i worked with files before, but no with searching for files in directories and arranging them in an array.
coz, there is parent directory, which has subfolders.these subfolders has files.
the OS is Winxp, VC++ compiler.
Another option if MSDN scares you is to download the Boost::filesystem library. If you can figure out how to build it and link with it then writing your program would be a breeze. But I still recommend using the Win32 API, and my link is a great start.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.