[comp.sys.apollo] Domain/OS 10.2 and 10.3 questions

mcc1203@sei_4.lerc.nasa.gov (06/13/91)

I'm a summer intern here at NASA Lewis and I am working 
with some system calls in a graphics program I wrote
with GPR (in FORTRAN).  The problem is that the 10.2 version 
of the operating system is case sensitive, and when I
call NAME_$READ_DIR to get the name of the files in
the current working directory, it returns them in ALL CAPS.
I couldn't believe it.  Now how am I supposed to know 
the actual name of the files?  

Also, we just installed 10.3 on our 10000, and I couldn't 
figure out how to call NAME_$READ_DIR since the parameters
have changed.  Anyone have any hints on how to call
NAME_$READ_DIR on 10.3.  Thanks.

			Mark Cutshaw
			NASA Lewis Research Center

thompson@PAN.SSEC.HONEYWELL.COM (John Thompson) (06/13/91)

> I'm a summer intern here at NASA Lewis and I am working 
> with some system calls in a graphics program I wrote
> with GPR (in FORTRAN).  The problem is that the 10.2 version 
> of the operating system is case sensitive, and when I
> call NAME_$READ_DIR to get the name of the files in
> the current working directory, it returns them in ALL CAPS.
> I couldn't believe it.  Now how am I supposed to know 
> the actual name of the files?  
> 
> Also, we just installed 10.3 on our 10000, and I couldn't 
> figure out how to call NAME_$READ_DIR since the parameters
> have changed.  Anyone have any hints on how to call
> NAME_$READ_DIR on 10.3.  Thanks.

RTFM.  Try reading the /sys/ins/name.ins.ftn file that you should be
including in your source code --
:: C   --------------------------------------------------------------------- 
:: C   READ_DIR -- READ THE ENTRIES IN THE SPECIFIED DIRECTORY
:: C   ( The index argument to this call ...)
:: C       This call is OBSOLETE use name_$read_dir_lc
:: C
:: C   SUBROUTINE  name_$read_dir (pname, length, elist,
:: C                                    index, maxcnt, readcnt, status)

Now, doing what they say (using name_$read_dir_lc) will give you a 
different routine.
:: C   --------------------------------------------------------------------- 
:: C   READ_DIR_LC -- READ THE ENTRIES IN THE SPECIFIED DIRECTORY
:: C   ( Programs should set seek_to_bof to true before their first call to read_dir.
:: C     The elist returned will hold no more than MAXCNT dir entries.  If there
:: C     are more than MAXCNT entries in the directory, or more entries then will
:: C     fit into the elist buffer, cursor will be updated so that a second call 
:: C     to read_dir_lc will obtain the "next" batch of entries.
:: C     
:: C   SUBROUTINE  name_$read_dir_lc (pname, length, seek_to_bof, cursor,
:: C                                  maxcnt, bufsize, elist, readcnt, status)
:: C
:: C  (input)  pname       -- character*n  -- pathname of the directory to be read
:: C  (input)  length      -- integer*2    -- number of useful characters in 'pname' 
:: C  (in/out) seek_to_bof -- logical      -- set to true to start read at beginning of dir
:: C  (in/out) cursor      -- character*300
:: C  (input)  maxcnt      -- integer*2    -- max number of entries elist will hold
:: C  (input)  bufsize     -- integer*4    -- size (in bytes) of elist buffer
:: C  (output) elist       -- integer*2 elist(512,n)
:: C                                       -- array to hold entry data, 'n' entries worth
:: C  (output) readcnt     -- integer*2    -- number of valid entries stored in elist
:: C  (output) status      -- integer*4    -- status of the call

This is the call that you _SHOULD_ have been using all along.  The NAME_$xxx calls
were case insensitive (returning uppercase) because of sr9.7.  Starting at sr10.0,
the file system became case-SENSITIVE, and allowed for longer pathnames and leafnames.
Thus was born the name_$xxx_lc ('long' 'case-correct' I'd guess) set of calls.  Apollo
left the name_$xxx calls in, so that people's code didn't break.  This is one case
where I fully agree with them -- too many things would have been broken if they had
removed the call OR if they had modified the call, rather than coming up with a new
one.  Apollo also provided for an environment variable DOWNCASE that, if set true,
would give you case-insensitivity at the cost of decreased performance.  I don't
know if DOWNCASE is supported at 10.3 (I wouldn't use it anyway), and I don't know
if the name_$xxx and ios_$xxx calls that have '_lc' counterparts are supported 
anymore.  They stated back in 1988 that the old calls might not be supported in 
future releases (Domain System Software Release Notes -- 10.0, page A-33).

-- jt --
John Thompson
Honeywell, SSEC
Plymouth, MN  55441
thompson@pan.ssec.honeywell.com

When in danger, when in doubt --
run in circles, scream and shout.