Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Simple File Search....

Author
Message
Al C
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location:
Posted: 28th Jan 2005 06:53
I am trying to create a search utility for certain files within a specified drive.

So far I cannot find a suitable search routine find files just like the *.* command within windows.

Just thought DBPro could do this sort of thing but so far it only looks like the command set is for files that you know exist in the directories.

Any help would be appreciated.
Jedi Lord
20
Years of Service
User Offline
Joined: 11th Jun 2004
Location: Jedi Temple
Posted: 28th Jan 2005 07:16
Only way you want to do it is to...
1. pick up the Gaint rock over your head.
2. Let go and let it hit ya
3. There you go now you can do it.
(don't blame me I don't know!)

All the help you will need
Catalyst
21
Years of Service
User Offline
Joined: 6th Sep 2003
Location:
Posted: 28th Jan 2005 07:40
It can be done pretty well actually. I can give you some code a bit later, but here's the basic idea. For finding one specific file:

x=file you want to find
look through all files, compare them to x
store all directories in variables
go into those directories and repeat search and directory store

I have code to do this for copying files, all you need to do is make it compare the string instead of copy. All files that match you can store the full path of.

If you need more help, I'll post some code later.
Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 28th Jan 2005 07:42
learn.

scan a drive for dolders, switch to the first folder (if it exists) keep going till no more folders, scan that folder for files. goto previous folder, keep going till all folders scanned.

use these commands
Find First
Find Next
Get File Type()


1800+ XP - GeforceFX 5600 - 256MbDDR - 60Gb Hdd - XP Pro (SP2)
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 28th Jan 2005 09:24
Mobiius has it right there.. Just out of interest.. Can DB do recurrsion? Like a function calling itself? Cos that'd work a treat here!

My Website:
Coding Fodder
21
Years of Service
User Offline
Joined: 25th Sep 2003
Location: Somewhere in my cerebralcortex
Posted: 28th Jan 2005 11:58
Quote: "Can DB do recurrsion?"


That is part of why I made my "connect four" program. It turns out that darkbasic does not seem to be intended to allow it. But with some funky manuvering you can.

Something really catchy that makes people stop and think about the meaning of life and say to themselves "My but thats clever"
Al C
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location:
Posted: 29th Jan 2005 07:09
Still having problems... Any sample code that I could play around with would be appreciated...

Login to post a reply

Server time is: 2025-05-29 06:13:01
Your offset time is: 2025-05-29 06:13:01