IOCTL Documentation

65 views
Skip to first unread message

Tom Turkington

unread,
Sep 17, 2008, 12:48:56 PM9/17/08
to jB...@googlegroups.com, jBASE Support - Devsup

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

800-867-7626 x4

t...@proman.com

 

Jim Idle

unread,
Sep 17, 2008, 1:01:09 PM9/17/08
to jB...@googlegroups.com, jBASE Support - Devsup
On Wed, 2008-09-17 at 09:48 -0700, Tom Turkington wrote:
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” ..

Sounds like a documentation bug and either a change in philosophy for the "directory as file" jEDI, or that it is not returning that it does not support that request.

I would file a bug report.

Jim


Tom Turkington

unread,
Sep 18, 2008, 1:36:09 PM9/18/08
to jBASE Support - Devsup, jB...@googlegroups.com

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.

 

Tom @ Proco, Inc

800-867-7626 x4

t...@proman.com

 

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

 


Reply all
Reply to author
Forward
0 new messages