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

Re: SQR File operations problem



Title: RE: SQR File operations problem

John,

Thank you very much.  Ran test (get directory for large folder over network) and it worked as desired.  I'm on Win95, but WAIT apparently will work for it as well as for NT.

Best regards,
Bob

-----Original Message-----
From: John Milardovic [mailto:milardj@SX.COM]
Sent: Thursday, November 04, 1999 12:02 PM
To: Multiple recipients of list SQR-USERS
Subject: Re: SQR File operations problem


Hi Bob.
        You might want to pass the WAIT parameter to your system call.  This
would suspend SQR execution until the system call has finished processing.
On NT the default is NOWAIT which might account for the inconsistent
behavior.

FROM SQR HELP
WAIT | NOWAIT - (Windows NT and VMS only)  - WAIT specifies that SQR suspend
its execution until the CALL SYSTEM command has finished processing. NOWAIT
specifies that SQR start the CALL SYSTEM command but continue its own
processing while that command is in progress.
For Windows NT, the default is NOWAIT.  For VMS, the default is WAIT. On
UNIX operating systems the behavior is always WAIT.  On Windows 3.1 the
behavior is always NOWAIT.
...
CALL SYSTEM USING command status [ WAIT | NOWAIT ]

HTH
John Milardovic

> -----Original Message-----
> From: Bob Buford-Abba Systems [SMTP:bbuford@GALEIND.COM]
> Sent: Thursday, November 04, 1999 11:07 AM
> To:   Multiple recipients of list SQR-USERS
> Subject:      SQR File operations problem
>
> My apologies for previous message (same text) with Subject 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
>