#134314 - Lick - Thu Jul 12, 2007 1:13 pm
Download
Demo: http://lickr.org/files/LicksLocator.zip (Demo searches for "DSLiveWeather" directory. Maximum depth is 3: /<1>/<2>/DSLiveWeather. Includes a timer.)
C file: http://lickr.org/files/LicksLocator.c
Scrolldown for melw's modified & better version
Description
It's simply a C function that searches for a directory or a file inside a certain start-directory and within a certain depth. Only 1 result is returned, but that's enough for many purposes.
Performance
It's fast enough, as long as you don't have thousands of directories in the depth range. The demo includes a timer, so see for yourself.
Usage
Example
This example will search for the DSLiveWeather directory within 3 depth levels starting from the root. It will find one of these:
- DSLiveWeather
- /<1>/DSLiveWeather
- /<1>/<2>/DSLiveWeather
_________________
http://licklick.wordpress.com
Last edited by Lick on Fri Jul 13, 2007 9:42 am; edited 2 times in total
Demo: http://lickr.org/files/LicksLocator.zip (Demo searches for "DSLiveWeather" directory. Maximum depth is 3: /<1>/<2>/DSLiveWeather. Includes a timer.)
C file: http://lickr.org/files/LicksLocator.c
Scrolldown for melw's modified & better version
Description
It's simply a C function that searches for a directory or a file inside a certain start-directory and within a certain depth. Only 1 result is returned, but that's enough for many purposes.
Performance
It's fast enough, as long as you don't have thousands of directories in the depth range. The demo includes a timer, so see for yourself.
Usage
Code: |
Locator(StartDirectory, SearchString, IsADirectory, Depth, OutputBuffer); |
Example
This example will search for the DSLiveWeather directory within 3 depth levels starting from the root. It will find one of these:
- DSLiveWeather
- /<1>/DSLiveWeather
- /<1>/<2>/DSLiveWeather
Code: |
Locator("/", "DSLiveWeather", true, 3, path); |
_________________
http://licklick.wordpress.com
Last edited by Lick on Fri Jul 13, 2007 9:42 am; edited 2 times in total