![]() |
Directory navigation
Hi,
I have a little shell script that does a handy function at my work. I was wanting to make it into an easy to use exe file for my colleagues using Windows. It's relying on directory changing and file searching. Its basically a simple file locator using a long int input by the user. So having used Python and wanting to learn C++ I thought this would be a good project for that. I have been doing some research on directory navigating in C++ to find its not as simple as with Python and BASH. Am I missing something ? Seems Boost library is pointed to a lot and many home baked solutions, but nothing standard. Am I search for this in a poor manner ? Any tips appreciated. |
Re: Directory navigation
No, you're right: there is no standard means of working with directories in C or C++, as the languages and standard libraries are designed to be able to work on a range of systems, including many that don't support disk drives (let alone, directory trees).
Under windows, look in the win32 API (the help file is installed by default with most commercial compilers: VC++, Borland, Watcom, etc) for functions named FindFirstFile() and FindNextFile(). |
Re: Directory navigation
Boost libraries are an excellent source for cross-platform functions such as that.
|
Re: Directory navigation
If you are on a Linux or BSD system and using gcc, glibc implements all the POSIX headers that make this sort of thing easy. http://www.gnu.org/software/libc/man...stem-Interface
If you need portability, then I would go with Boost. |
Re: Directory navigation
Awesome!!
Thanks for all this great info. Lots of links for me to follow up on. Thanks again guys !! :-D |
| All times are GMT -5. The time now is 4:20 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC