This JB3.4/Win32 - Just thought I would note in passing that JBase manpage documentation of IOCTL indicates:
INCLUDE JBC.h
OPEN "outputfile" TO DSCB ELSE STOP 201,"outputfile"
... Make up the output record to write out in "output"
key = "output.out"
rc = IOCTL(DSCB,JIOCTL_COMMAND_FINDRECORD,key)
BEGIN CASE
CASE rc EQ 0
CRT "No further action, record
already exists"
CASE rc GT 0
WRITE output ON DSCB,key
PRINT "Data written to key " :
key
CASE 1
CRT "IOCTL not supported for file
type"
END CASE
but my testing of same just now indicates that rc = 1 if item exists/rc = 0 if item doesn’t exist... Also this doesn’t appear to work at all if “outputfile” is a folder – always returns “0” ..
e.g.
jsh Tom ~ -->jshow SOH
File: c:\electric\proco\jbase\Rel4.4\PROMAN\SOH
jsh Tom ~ -->LIST SOH '1059X' (H
** Error [ 202 ] **
Record '1059X' is not on file
No Records selected
jsh Tom ~ -->FILE.EXISTS SOH\1059X
DEBUG statement seen
Source changed to C:\ELECTRIC\PROCO\JBASE\ZSOURCE\4.4\BP\FILEEXISTS.SUB
0089 DEBUG
jBASE debugger->S
0090 rc = IOCTL(Fldr,JIOCTL_COMMAND_FINDRECORD,lclKey)
jBASE debugger->S
0091 GOSUB PROCESS.RC:
jBASE debugger->/Fldr
Fldr : File 'c:\electric\proco\jbase\Rel4.4\PROMAN\SOH'
jBASE debugger->/lclKey
lclKey : 1059X
jBASE debugger->/rc
rc : 0
jBASE debugger->
Tom @ Proco, Inc
This JB3.4/Win32 - Just thought I would note in passing that JBase manpage documentation of IOCTL indicates:
INCLUDE JBC.h
OPEN "outputfile" TO DSCB ELSE STOP 201,"outputfile"
... Make up the output record to write out in "output"
key = "output.out"
rc = IOCTL(DSCB,JIOCTL_COMMAND_FINDRECORD,key)
BEGIN CASE
CASE rc EQ 0
CRT "No further action, record already exists"
CASE rc GT 0
WRITE output ON DSCB,key
PRINT "Data written to key " : key
CASE 1
CRT "IOCTL not supported for file type"
END CASE
but my testing of same just now indicates that rc = 1 if item exists/rc = 0 if item doesn’t exist... Also this doesn’t appear to work at all if “outputfile” is a folder – always returns “0” ..
C:\JBASE30\man\ManHtml\knowledgebase\manuals\3.0\30manpages\man\sup22_ioctl.htm
Mine is dated 1999; is from jb3.4.10 install; just checked a virgin install of 3.4.10; has same manpage.
Quite honestly, thought I checked knowledgebase @ jbase.com before posting this, but see that version is correct today. So maybe was cross-eyed.
From: jBASE Support -
Devsup [mailto:dev...@jbase.com]
Sent: Thursday, September 18, 2008 10:18 AM
To: Tom Turkington
Cc: jBASE Support - Devsup
Subject: RE: IOCTL Documentation
Tom,
The example in the documentation I see shows the correct information, eg:
INCLUDE JBC.h
OPEN "outputfile" TO DSCB ELSE STOP 201,"outputfile"
... Make up the output record to write out in "output"
key = "output.out"
rc = IOCTL(DSCB,JIOCTL_COMMAND_FINDRECORD,key)
BEGIN CASE
CASE rc EQ 0
WRITE output ON DSCB,key
CRT "Data written to key " : key
CASE rc GT 0
CRT "No further action, record already
exists"
CASE 1
CRT "IOCTL not supported for file
type"
END CASE
What manpage did you get this from?
Also, I get the same results when using this on a directory. I'm wondering if this is emulation dependent...or something else. Can you send a 'jdiag.out' file from this system please?
Dan