Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!caip!clyde!cbatt!cbosgd!ihnp4!inuxc!pur-ee!uiucdcs!uiucuxc!hamilton From: hamilton@uiucuxc.CSO.UIUC.EDU Newsgroups: net.micro.amiga Subject: Re: AmigaDOS problem Message-ID: <148600129@uiucuxc> Date: Wed, 20-Aug-86 20:17:00 EDT Article-I.D.: uiucuxc.148600129 Posted: Wed Aug 20 20:17:00 1986 Date-Received: Sat, 23-Aug-86 02:11:49 EDT References: <1646@well.UUCP> Lines: 53 Nf-ID: #R:well.UUCP:1646:uiucuxc:148600129:000:2266 Nf-From: uiucuxc.CSO.UIUC.EDU!hamilton Aug 20 19:17:00 1986 /* Written 8:53 pm Aug 17, 1986 by crunch@well.UUCP in uiucuxc:net.micro.amiga */ /* ---------- "AmigaDOS problem" ---------- */ I am trying to whip up a simple directory display program and want to be able to detect when the last file has been displayed. According to the manual which is INCORRECT and INACCURATE (Thank you, MetaCompco, take a bow), I quote from page 2-5 of the developers DOS (dog?) manual: "ExNext gives a return code of zero if it fails for some reason. One reason for failure is reaching the last entry of the directory. However, IoErr() holds a code that may give more information on the exact cause of a failure. WHEN ExNext FINISHES AFTER THE LAST ENTRY, IT RETURNS: ERROR_NO_MORE_ENTRIES (232)". FLAME ON: BULL BULL AND MORE BULL PILED HIGHER AND DEEPER!! Nothing can be further from the truth. After EACH AND EVERY ExNext call I get the ERROR_NO_MORE_ENTRIES returned values. FLAME OFF: If anyone from Amiga cares to comment on this, I would appreciate an answer. This is not only MY problem, but a dozen other programmers from the Programmers Net also would like the answers. /* End of text from uiucuxc:net.micro.amiga */ john, the behavior you describe, suboptimal as it may be, does not conflict with the documentation. note that they did _NOT_ say: "[IoErr] returns [232] _ONLY_ after the last entry" it doesn't take that careful a reading to see that end-of-directory is indicated by the conjunction (ExNext() == 0) _AND_ (IoErr() == 232). the manual goes on to describe the procedure for walking a directory: "keep calling ExNext _until it fails_ with error code [==232]". i have written several programs that successfully walk the file system. i just now modified one of them to print IoErr() after successful ExNext()s, and i get a variety of values (232, 212, 205) even as correct results are coming back (ie, the file info block stuff is right). i'll post my code if there's interest. wayne hamilton U of Il and US Army Corps of Engineers CERL UUCP: {ihnp4,pur-ee,convex}!uiucdcs!uiucuxc!hamilton ARPA: hamilton%uiucuxc@a.cs.uiuc.edu USMail: Box 476, Urbana, IL 61801 CSNET: hamilton%uiucuxc@uiuc.csnet Phone: (217)333-8703 CIS: [73047,544] PLink: w hamilton