This is a little clunky, but it will get you the path to the file.
First, write a batch file named findit.bat (or whatever name you would like) that searches for the file and outputs the results to a know location like this:

@ECHO OFF
DIR c:\%1 /S /B > c:\results.txt

Next, use the R:BASE LAUNCH command to run the search (this depends on you knowing the file name to search for).

LAUNCH c:\findit.bat|<FILENAME.EXT>

Next read the results into a temporary table.

GATEWAY IMPORT TXT c:\results.txt CREATE TEMP fsresults

Then create some variables in R:BASE to process the results

SET VAR vfileandpath TEXT = NULL
SET VAR vpath TEXT = NULL

Next, pull the result out of the temp table.

SELECT field1 INTO vfileandpath FROM fsresults

Lastly, use SRPL to strip out the filename from the full result to give you just the path.

SET VAR vpath = (SRPL(vfileandpath,'filename.ext','',0))

When you are done, you can DROP the temp table.

This method has some drawbacks:
1 - It is kind of clunky.
2 - It is requires you to know the drive the files is saved to, and and to know the file name.
3 - It will require extra coding on your part if there is more than one file on the drive with the same name.

You can always cycle through all the returned files and prompt the user for which is the best (or try to read the timestamps and pick the most recent) to address problem 3.

You could also use a _vbscript_ file instead of a batch file to hunt for the target file.  This would probably allow for an easier time dealing with multiple possible drives, and you could process the filename and path info in _vbscript_ and just return the path so you don't have to process that in R:BASE.
Jason Kramer
University Archives and Records Management
002 Pearson Hall
(302) 831 - 3127 (voice)
(302) 831 - 6903 (fax)


jan johansen wrote:
Marc,
 
While it looked like a good idea there was a couple of issues.
1. FINDFILE will look in the current directory and in the DOS path.
So if the file was saved somewhere outside the path nothing is found.
2. FINDFILE requires the name of the file to locate. If the user downloads
five files, I don't have a filename to locate.
 
Nice idea though. Thanks. This user is getting more used to idea that
she does have to do some work. I can't do it all for her ;)
 
Jan




Reply via email to