GERHARD@HROEUR5.BITNET (11/12/86)
I have a problem with LIB$FIND_FILE. I use this routine to set the default one level higher, but when I call it repeatedly I get back the same default after one time. It probably has something to do with a context block that is not deallocated, though I use LIB$FIND_FILE_END after each call to LIB$FIND_FILE. I use them the following way, both routines correctly declared: Context := 0; LIB$FIND_FILE('[-]', Default, Context, Default); LIB$FIND_FILE_END(Context); Has someone an idea what might be the problem? Kind regards, Gerhard GERHARD@HROEUR5.BITNET
carl@CITHEX.CALTECH.EDU (Carl J Lydick) (11/14/86)
> I have a problem with LIB$FIND_FILE. I use this routine to set the default > one level higher, but when I call it repeatedly I get back the same > default after one time. It probably has something to do with a context > block that is not deallocated, though I use LIB$FIND_FILE_END after each > call to LIB$FIND_FILE. I use them the following way, both routines > correctly declared: > > Context := 0; > LIB$FIND_FILE('[-]', Default, Context, Default); > LIB$FIND_FILE_END(Context); > > Has someone an idea what might be the problem? Since you've explicitly specified a directory in the file-spec you gave to LIB$FILE_SCAN(), the directory part of default-spec is ignored. If you want to set your default one level higher, use SYS$SETDDIR() to do so; if you just want to scan for files, do something along the lines of: DEFDIR = ']' ... ... ICTX = 0 LIB$FIND_FILE('['//DEFDIR, FILE, ICTX, wild-spec) ... DEFDIR = '-'//DEFDIR ... END