Link to home
Start Free TrialLog in
Avatar of MitchelG
MitchelG

asked on

Directory search routine

I'm looking for a fast disk directory search routine in C or C++.   This code will be part of a post login script that will allow us to perform a software inventory across our network (8000+ users) and I'd like to make it as transparent as possible to our users.  It will need to be able to detect multiple local drives to search and then search for all filenames given in a text file.
Avatar of mikeblas
mikeblas


Get NJFIND16.ZIP from http://www.nwlink.com/~mikeblas/samples/. I wrote it almost 10 years ago: it is 16-bit DOS app that works on DOS 3.x, 4.x, 5.x, and 6.x, and is compatible with more than half a dozen archive file formats (like ZIP, ARC, and LZH).

.B ekiM

What is the platform it will fun on?  DOS?  Win9x/NT?  Unix?
Would you like to detect and search only local drives or networked too?
Would you like a tool or source code?
Have you already received an answer?

Avatar of MitchelG

ASKER

mikeblas,

  I can't get this to work it seems to be making DOS calls to, I think, find out what drive types are on the system.  It appears to be dieing at that point.  I would love more assistance.  I'm also working with alexo on this and would really like to grade your work, but I'm not sure the best way to do it, as I'm sure the code is great, I just can't get it to work for me.  Can I get your EMail address somewhere so we can resolve this quickly and you can get your points.

  Unfortunately for me this is just one piece of a much bigger project and I'm in a bit of a rush.  I definetly don't want to sound rude or demanding, I just wanted you to know that it's a hot item on my plate and I'd sure love to put this piece behind me.

  Thanks in advance for your time, patience, and expertise,
 
       Mitch
Don't wait for me.
I've re-opened this hoping someone has a soultion using only C or C++ and no assemler, perhaps a recursive findfirst/findnext routine.
Mithel, recursive findfirst/findnext is the least of your problems because it is fairly trivial.
What you need is a method to determine whether a drive is local, remote, floppy or nonexistant.
Alex, I'm not disagreeing but at this point I need something finding files on at leaset C drives (Luckily, our H/W configurations are 'fairly' fixed, nearly all machines have only one floppy [the A drive] and few have more than two hard drives, none can have local drive letters above G and most have one CD), I can add the Local/Network/CD file detection later.  Nonexistant drives shouldn't present a problem as even findfirst returns an error code so if that's checked for on the root directory of any drive, that's handled).  So, although it is the least of my troubles, it is still one of my troubles and I'd like a routine that works that will help me out with it.
ASKER CERTIFIED SOLUTION
Avatar of alexo
alexo
Flag of Antarctica 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
Works great thanks
Have Fun!
My code works fine for DOS.  Did you mean to mention in your original question that you were working on a specific operating system?

B ekiM
Mike,

  Perhaps, I wasn't specific enough.  I could not get it to run under Win95 in a DOS window.