From: Craig A. Berry [craig.berry@SignalTreeSolutions.com] Sent: Saturday, October 26, 2002 10:56 AM To: Info-VAX@Mvb.Saic.Com Subject: Re: OpenVMS 7.3-1 and CSWING In article , rdeininger@mindspring.com (Robert Deininger) wrote: > >Searching, root = SHODAN:[000000] > >%SYSTEM-W-NOSUCHFILE, no such file > > Ah! This is useful. "No such file" means we asked for a file spec that > isn't there. > > Might be worth looking at whether the program deals with this condition > properly. From get_dirs in swing.c after an IO$_ACCESS qio: /* ** file in dir but not indexf.sys */ if (iosb[0] == SS$_NOSUCHFILE) { fib.fib$l_wcc++; continue; } Isn't the "wild card context" of the file information block one of those opaque longword values that one should not depend on coming in sequence, much less increment oneself and hope that doing so will not get you in trouble? I certainly don't see anything in the I/O User's Guide that suggests I could predict or should attempt to influence the value of the wcc. I have a strong suspicion that the code I've quoted is the source of the looping problem. Section 1.3.1.2 of the I/O User's Guide says: "On the first lookup, FIB$L_WCC should contain zero entries. On each lookup, the ACP returns a nonzero value in FIB$L_WCC, which must be passed back on the next lookup call. In addition, you must pass the resultant name string returned by the previous lookup using the P4 result string buffer, and its length in the P3 result length word. This string is used together with FIB$L_WCC to continue the wildcard search at the correct position in the directory." The code in question, in addition to depending on what appears to be undocumented (and apparently obsolete) behavior of the context value, also does not pass the previous result name on subsequent calls (it zeros the first byte of the name string before each QIO and also zeros the length). John Malmberg's approach of following the compiler warnings will no doubt bring great improvement to the package, but there are also things that should be rethought and possibly reimplemented. I would expect that lib$find_file (or even readdir() for that matter) would offer a more maintainable method for getting a directory listing than the QIO method.