Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 23-11-2009, 06:12 AM   #1 (permalink)
In The Zone
 
Join Date: Sep 2005
Posts: 227
Default School Computer Project.. searching directories?


Hey,
Im in class 12 right now (read : excuse for my inactivity) and I thought that for my board project, I'd end up making an ebook library, mostly because I really need one. One of the things that I need this program to do is to search/scan the computer for all pdf,lit,txt,doc etc etc files (a la, Mediamonkey or iTunes) and write their names and paths to a file. Now I'm pretty sure I can use normal fstream for the writing bit, but I can't find a function to search the computer- findnext and findfirst (from the turbo c++ help files) don't search sub-directories within the ones that i specify for example if i were to say search C:\ it won't look up C:\docs.
Is there anyway around this?
__________________
Our deepest fear is not that we are inadequate Our deepest fear is that we are powerful beyond measure
karmanya is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 23-11-2009, 01:32 PM   #2 (permalink)
Wise Old Owl
 
harryneopotter's Avatar
 
Join Date: Feb 2007
Posts: 1,009
Default Re: School Computer Project.. searching directories?

Write a Function which takes a directory path ("C:\", or C"\Docs") as argument and then scans the directory and get a list of all the subdirectories. Then recursively call the same function for each of the subdirectories found.

this method will do IMO !!

Example Code:

Quote:
Void search(string path)
{
..... use ur code to search for subdirectories.....
and then for each of the subdirectories found .....

search(subdirectory);

.......
....
}
-----------------------------------------
Posted again:
-----------------------------------------
Write a Function which takes a directory path ("C:\", or C"\Docs") as argument and then scans the directory and get a list of all the subdirectories. Then recursively call the same function for each of the subdirectories found.

this method will do IMO !!

Example Code:

Quote:
Void search(string path)
{
..... use ur code to search for subdirectories.....
and then for each of the subdirectories found .....

search(subdirectory);

.......
....
}
__________________
Wats the Favourite Mathematical Function of DIGIT FORUM ????

Its "A SINE WAVE" constant

Y ??

They Both keep going "UP AND DOWN, UP AND DOWN............" !!!!!!!!

Last edited by harryneopotter; 23-11-2009 at 01:33 PM. Reason: Automerged Doublepost
harryneopotter is offline  
Old 23-11-2009, 01:56 PM   #3 (permalink)
Section Moderator
 
gopi_vbboy's Avatar
 
Join Date: Mar 2007
Location: Hyderabad
Posts: 1,186
Default Re: School Computer Project.. searching directories?

write a progam to genrate sine wave
gopi_vbboy is offline  
Old 24-11-2009, 09:09 PM   #4 (permalink)
In The Zone
 
Join Date: Sep 2005
Posts: 227
Default Re: School Computer Project.. searching directories?

@harryneopotter Erm, how exactly do i scan for directories? Since find_next and find_first don't even pick them up.
__________________
Our deepest fear is not that we are inadequate Our deepest fear is that we are powerful beyond measure
karmanya is offline  
Old 28-12-2009, 12:27 PM   #5 (permalink)
In The Zone
 
vandit's Avatar
 
Join Date: May 2005
Location: If I had a webcam u could have seen me, before your eyes.
Posts: 459
Default Re: School Computer Project.. searching directories?

http://www.devarticles.com/c/a/Cplus...n-Cplusplus/2/

this might be of some help. And I recollect there is some funtion by a similar name to what you said.. sorry dont have the access to turbo c manuals currently..
__________________
Searching for dell studio 15 ??
dell studio 15 review @ my blog

vandit007.blogspot.com

And remember the stylus that comes along with the touchscreens isnt meant for cleaning your ears !!
vandit is offline  
Old 28-12-2009, 08:21 PM   #6 (permalink)
I am the Legend.........
 
Join Date: Aug 2006
Location: sangli
Posts: 30
Wink Re: School Computer Project.. searching directories?

run command line dir *.txt *.pdf /s >new.txt from c.
__________________
a sudoku web app designed using gwt and gae.- http://solvemysudoku.appspot.com
my blog- http://aniketawati.blogspot.com
aniket.awati is offline  
Closed Thread

Bookmarks

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CVS (Computer Vision Syndrom) techiways QnA (read only) 9 03-01-2009 04:27 PM
Using Notebook as Wireless router INS-ANI Tutorials 18 26-11-2008 09:54 AM
HOW TO - Boot up Windows XP 60 times faster! vaibhavtek Tutorials 31 09-01-2008 01:55 PM
VIrus aaaaaaaaa tushar_novice Software Q&A 25 04-01-2005 04:32 PM
Bizzy's Guide to Good Hard Drive Maintenance bizzyboy QnA (read only) 3 29-12-2004 09:50 PM

 
Latest Threads
- by Charan
- by Charan
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 03:12 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2