![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
|
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. |
|
|
|
|
|
#2 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,198
Rep Power: 5
![]() |
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(). |
|
|
|
|
|
#3 |
|
PFO God In Training
![]() Join Date: Jun 2005
Location: near St Louis, MO. (USA)
Posts: 498
Rep Power: 4
![]() |
Re: Directory navigation
Boost libraries are an excellent source for cross-platform functions such as that.
__________________
I Like Ike. Vote for Dwight Eisenhower this November. --This message brought to you by the the Procrastinators Club Of America. |
|
|
|
|
|
#4 |
|
The Oblivious One
Join Date: May 2005
Location: Ontario, Canada
Posts: 630
Rep Power: 4
![]() |
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.
__________________
Dr. Zoidberg: [ecstatic] I'm going to a movie... with FRIENDS! |
|
|
|
|
|
#5 |
|
Newbie
|
Re: Directory navigation
Awesome!!
Thanks for all this great info. Lots of links for me to follow up on. Thanks again guys !! :-D |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to create Directory.. | Tajinder Singh | C++ | 5 | Aug 2nd, 2007 11:49 AM |
| Directory Security | PhilBon | Visual Basic .NET | 4 | Jul 12th, 2007 10:52 AM |
| Allow user to select a directory | MegaArcon | HTML / XHTML / CSS | 11 | Jun 5th, 2006 8:38 AM |
| how to recursively copy or move part of a directory limited by size? | linuxpimp20 | Bash / Shell Scripting | 2 | Jul 6th, 2005 11:51 AM |
| Bash script to access all files in a directory | shinni | Bash / Shell Scripting | 4 | Feb 18th, 2005 3:26 PM |