So I'm wanting to develop an application that is preferably a text based console and uses vanilla, non-Microsoft C++ (i.e. no _tmain(int argc, _TCHAR* argv[]), APIENTRY _tWinMain()), .net framework, etc. if possible. I'm not against using an API but I'd like to try to make the code easy to port to Linux. Plus I'm an absolute beginner at windows programming. I understand that there are some POSIX directory manipulation functions in a C header called "dirent.h" that are ported for windows API but it doesn't get along with the VS 2008 compiler.
What I want to do is allow the user the option to select a data file or directory from any where in windows, create a new directory or data file if asked, and to load the file into memory. So I need 2 creation options and 2 selection options for files and directories.
The Important Question:
How do I do this in just a regular c++ console app? I understand C++/STL doesn't provide that kind of stuff for windows. Is there any way to do this with a well documented API or some other way to abstract the win32 stuff? If not can somebody lead me to some up to date tutorials demonstrating directory manipulation?
Is there no good solution to this problem? No one has developed a wrapper for these operating system functions? I guess I will have to download some .net garbage or continue searching page after page of google hoping to stumble upon something that give a coherent example. I would have thought that this was a generic problem but I suppose I'm wrong.
Thanks firedraco. I actually have checked it out and found out that it doesn't allow you to do purposeful things like changing the working directory for instance. I've complied the boost::filesystem libs using bjam and that was almost enough to pull my hair out trying to figure that out, because some of the libs do not come pre-compiled.
I had high hopes for filesystem, its the reason I went through all the trouble of setting Boost up, but it's really not that well documented. The names and behaviors of the functions in filesystem are being changed frequently enough that all but the most resent third party documents are unreliable.
simple_ls.cpp and the tutorial on the "Life of Andrew" blog are most helpful, but a clueless guy like me can invest many hours into something like this and then find out that it doesn't do what I need, which is to change the working directory so I can manipulate files elsewhere instead of the default directory. The default isn't even the directory that the executable is located. And also I want to allow the user the opportunity to chose the directory to save a file and so on, but unfortunately filesystem doesn't serve this purpose yet.
Until it has been more fully developed I most find an alternative. I don't know much about win32 programming but I am guessing that SetCurrentDirectory() is maybe the way to go, but I'm finding a lot of information about it coming from posts in forums around the years 1999 - 2000! Should I just start developing for Linux now?