Link to home
Start Free TrialLog in
Avatar of uta2002
uta2002

asked on

Disk drive searching

I need a source code in C++ that will do this:
   Searches and find a file in a disk drive, when I type the name of the file that I am looking for after a promt line.
Avatar of captainkirk
captainkirk

I take it this is a console application that you are writing - there are utilities to do this very same thing, so I must assume this is a homework assignment....

Can you post what code you have so far and then we can help you move it along????

ASKER CERTIFIED SOLUTION
Avatar of Axter
Axter
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Agree with Axter. Post information about OS and Compiler.
opendir and readdir should work on most Unixes as well as Dos/Windows when using Borland C or GCC.
>>opendir and readdir should work on most Unixes as well
>>as Dos/Windows when using Borland C or GCC.
I didn't know that.  I can see why GCC would support opendir, but I wonder why Borland C supports it.

Do they also support findfirst?
>>so I must assume this is a homework assignment....

Might be too harsh, I came here because I need to do this also - but not for homework, if only I *was* a student again :-)
>> I wonder why Borland C supports it
Dunno either, but they do, at least Borland mentions them (directory streams) in the help files :)

Maybe it's homework, maybe he just wants a nice tool to find a file once in a while. I've been contemplating an easier version of change-dir (their used to be a dos tool like it)
>>I've been contemplating an easier version of change-dir
>>(their used to be a dos tool like it)

I created wrapper functions to allow findfirst/findnext to work with compilers that only support opendir/readdir.

I did that so I didn't have to change my code when I port it to unix.  But I guess now I could use it if I ever need to port it to Borland C or GCC.
I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days.
Unless there is objection or further activity,  I will suggest to accept "KangaRoo" comment(s) as an answer.

If you think your question was not answered at all, you can post a request in Community support (please include this link) to refund your points.
The link to the Community Support area is: https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt

Please do not accept this comment as an answer!
======
Werner
Force/accepted by

Netminder
Community Support Moderator
Experts Exchange