Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using clipper application to locate files 2

Status
Not open for further replies.

fbizzell

Programmer
Jul 3, 2000
217
Is there a clipper function or can a program be written in Clipper to locate a file and record the directory where the file is located? In other words I want to put in a file name, locate it with clipper and move it to another directory of my choice.
 
Use DIRECTORY() or ADIR() to read a directory.
Use ASCAN() or AEVAL() to look for the filename.
Use COPY FILE or CA Tools FILECOPY()/FILEDELETE() or FILEMOVE() to move them.

You can then look for directories in the origional DIRECTORY() or ADIR() and do it all over again. Alternatively you could run a command line
DIR WHATFILE.EXE /S > FILENAME.TXT
and process the resulting text file that contains the results. Ian Boys
DTE Systems Ltd
 
Thanks. I will try using ADIR(). I had forgotten about that function.

 
Be csreful when checking for the file name. Being 16-bit, Clipper's Directory fumction returns only DOS 8.3 file names, NOT long file names.

 
Of course you could get Klas Engwell's long filename library. Ian Boys
DTE Systems Ltd
 
Thinking about it the long filename problem is probably a very good reason to use the DIR > FILENAME.TXT method and analyser the text file. Ian Boys
DTE Systems Ltd
 
I used the Dir >filename.txt and then append the results into a data file that I created, then I only read the 4th record that contains the directory location. Kind of crude but it gets the job done.

 
Bozz,

Could you elaborate on the long filename library? as I have used dblfn.lib, but that doesn't apply to W2K (can't find a file using 'restore from ...'), and I'm still looking for a good long filename 'plug-in' for Clipper.

TIA
TonHu
 
IAN!!!!!!!!!!!!!!!!!!!!!!!!!!!

Thank you so much for the link, have searched entire google, but no way to find Klas over there :-(
Trying out the lib right now, altough it's very late already s-)

Thanks a million!
TonHu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top