From: MERC::"uunet!CRVAX.SRI.COM!RELAY-INFO-VAX" 18-MAY-1992 20:50:14.87 To: info-vax@kl.sri.com CC: Subj: LIB$FIND_FILE bug ? Help, please! FNAL, MS #352, X-8591 (off.), 16-MAY-1992 - 17:32 Hi, folks! I detected a very strange bug (?) in LIB$FIND_FILE RTL routine. Please, look at this simple test program for parsing wildcard files. FORTRAN, sorry :-) . C---------------------------------------------------------------------- Program Test Implicit None Character*255 File /' '/ Integer LFile, IContext, Len, IChar Logical IOK, Lib$Find_File C Data IOK /.True./, IContext /0/, LFile /1/ C 1 IOK = Lib$Find_File ( & '*.*.*', & File, & IContext, & , & File(1:LFile), & , ) If ( IOK ) Then LFile = Len( File ) Do While ( ( File(LFile:LFile) .eq. ' ' ) .or. & ( IChar(File(LFile:LFile)) .eq. 0 ) ) LFile = LFile - 1 End Do Type '(1X,A)',File(1:LFile) C Open ( Unit = 1, File = File(1:LFile), Type = 'Old', C & Readonly ) C C **** Here could be some stuff for working with the file contents C C Close( Unit = 1 ) Go To 1 End If Call Lib$Find_File_End( IContext ) Call Sys$GetMsg(%Val(IOK),LFile,File,,) Type '(1X,A)',File(1:LFile) C End C----------------------------------------------------------------------- This program works fine when the Open - Close block is commented. But if you'd try to uncomment it the behaviour became very funny - the program still works fine with the disk files. But whenever you try to run it on the files on the TAPE which is mounted as a file device (i.e., without /FOREIGN qualifier), the program doesn't exit after the all files processing - it goes into infinite loop, rescanning the tape again and again! Without Open-Close, however, all is OK even with tapes. I use Exabyte tapes mounted on the standard TK50 emulating drive. I didn't try it on ordinary tapes but it seems that there is no difference. I'm quite unhappy with this funny bug - of course it's possible to obtain the list of all appropriate files first and then open them one-by-one using this already built list, but that would mean the processing of the tape twice, which is twice longer! Now I'm playing with the VAXCRTL routines and may be they would help, but still I don't understand the origin of this bug. I would be really grateful to anybody who helps with this problem. May be it is real RTL bug and I should send it to DEC? I work under VMS V5.5. Sorry for previous empty posting Thanx a lot in advance! Have fun! Greg Landsberg GLL@FNAL.FNAL.GOV ---------------------------------------------------------------------------- | ******* Gregory L. Landsberg ******* | E-mail (Internet): | | (D0 Collaboration, GAMS Collaboration) | Landsberg@sbhep2.phy.sunysb.edu | | SUNY at Stony Brook, Physics dept. | Landsberg@d0sb09.fnal.gov | | Mail: MS 352 Fermilab Batavia IL 60510 | GLL@fnal.fnal.gov | | FAX: (708) 879-0048 | E-mail (BITNET): | | Voice: (708) 840-3105 off, 840-4228 apt | Landsberg@SBHEPNY or GLL@FNAL | ----------------------------------------------------------------------------