[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Rounding



Title: RE: Rounding

Good morning,

I have an inconsistent behavior in an SQR file operation for which I need some counsel.

I have to obtain names of files in a directory on a networked drive.  Based on the list of names (which I then put into an array), I then open each file in turn and read contents into my database.

I use CALL SYSTEM USING COMMAND.COM /C DIR ...  and redirect output into a file that I then read.  My problem is that sometimes the file is not created.  I suspect it may be because the response from the networked drive may come too late for the code execution.  Even if that is true, I'm not sure how to proceed.

My code:
   let $SrcDir = '\\raven\psft\interfaces\wo\'
   let $DirFile = 'c:\dirfile.txt'
   let $FilePrefix = 'galwk'
   let $DATType = '.*'

   let $cmd = 'command.com /C dir ' || $SrcDir
   let $cmd = $cmd || $FilePrefix || '*' || $DATType || ' > ' || $DirFile

   !$cmd thus is 'command.com /C dir \\raven\psft\interfaces\wo\galwk*.* > c:\dirfile.txt'

   call system using $cmd #status
   #debug show 'executed ' $cmd ', status=' #status
   if #status <> 0
       goto ExitProc
   end-if
   open $DirFile as #DirFile for-reading record=65:vary status=#status

When it fails I get #status=-1.000000

TIA

Bob