Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 11th, 2008, 12:55 AM   #1
DaveQB
Newbie
 
DaveQB's Avatar
 
Join Date: Apr 2006
Location: Sydney
Posts: 14
Rep Power: 0 DaveQB is on a distinguished road
Send a message via ICQ to DaveQB Send a message via Skype™ to DaveQB
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.
DaveQB is offline   Reply With Quote
Old Mar 11th, 2008, 4:04 AM   #2
grumpy
Programming Guru
 
grumpy's Avatar
 
Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,198
Rep Power: 5 grumpy is on a distinguished road
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().
grumpy is offline   Reply With Quote
Old Mar 11th, 2008, 6:26 AM   #3
Ancient Dragon
PFO God In Training
 
Ancient Dragon's Avatar
 
Join Date: Jun 2005
Location: near St Louis, MO. (USA)
Posts: 498
Rep Power: 4 Ancient Dragon is on a distinguished road
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.
Ancient Dragon is offline   Reply With Quote
Old Mar 11th, 2008, 9:30 AM   #4
Jessehk
The Oblivious One
 
Jessehk's Avatar
 
Join Date: May 2005
Location: Ontario, Canada
Posts: 630
Rep Power: 4 Jessehk is on a distinguished road
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!
Jessehk is offline   Reply With Quote
Old Mar 11th, 2008, 8:47 PM   #5
DaveQB
Newbie
 
DaveQB's Avatar
 
Join Date: Apr 2006
Location: Sydney
Posts: 14
Rep Power: 0 DaveQB is on a distinguished road
Send a message via ICQ to DaveQB Send a message via Skype™ to DaveQB
Re: Directory navigation

Awesome!!

Thanks for all this great info.

Lots of links for me to follow up on.

Thanks again guys !! :-D
DaveQB is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:03 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC