mcc1203@sei_5.lerc.nasa.gov (06/14/91)
INTEGER*2 DIRL(512,300), DIRLEN INTEGER*2 MAX, MAXR INTEGER*4 BSIZE, NFILES INTEGER*4 STATUS CHARACTER*128 DIRNAM CHARACTER*300 CURSOR CHARACTER*(*) PATH LOGICAL SEEK DIRNAM = PATH MAX = NFILES DIRLEN = NUMCHR(DIRNAM) SEEK = .TRUE. BSIZE = 512 * 300 * 2 CALL NAME_$READ_DIR_LC (DIRNAM, DIRLEN, SEEK, CURSOR, MAX, O BSIZE, DIRL, MAXR, STATUS) What I'm trying to do in the above code is get the names of the files in the directory DIRNAM. Could someone please look at the above code to try to find out what is wrong. This is exactly what the 'name.ins.ftn' file says to do, but for some reason it gets all blanks for the file names. From the debugger, I know that DIRNAM, DIRLEN, and MAX are all correct and I also know that it returns 42 in MAXR, so it's doing something at least 42 times (which is about the number of files in the directory). By the way, why is the documentation for the NAME_$READ_DIR_LC subroutine different in the 'name.ins.ftn' file from that in the system call reference manual? Which one is correct? Neither? :-) Mark Cutshaw NASA Lewis Research Center
philip@cel.cummins.com (Philip D. Pokorny) (06/15/91)
Mark Cutshaw writes:
Could someone please look at the above code to try to find out
what is wrong. This is exactly what the 'name.ins.ftn' file
says to do, but for some reason it gets all blanks for the file
names. From the debugger, I know that DIRNAM, DIRLEN, and MAX
are all correct and I also know that it returns 42 in MAXR, so
it's doing something at least 42 times (which is about
the number of files in the directory).
By the way, why is the documentation for the NAME_$READ_DIR_LC
subroutine different in the 'name.ins.ftn' file from that in
the system call reference manual? Which one is correct?
Neither? :-)
If you check out the name_$extract_data_lc call it mentions that it
is explicitly for FORTRAN programs that are using name_$read_dir_lc
You might look at /sys/help/calls/name_$intro and
/sys/help/calls/name_$extract_data_lc or
/sys/help/calls/name_$read_dir_lc. All of which you can get from the
DM by using <Help>calls/name_$... All of the system call man pages
are there in the calls directory if your system administrator installed
them... They are REAL handy...
:)