Date: Fri, 2 Apr 1999 09:03:40 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Frank Frederiksen cc: djgpp AT delorie DOT com Subject: Re: Strange errors with _get_dev_info In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Fri, 19 Mar 1999, Frank Frederiksen wrote: > > /* Scan from c: and upwards */ > > for(drive=2;drive > if(_get_dev_info(drive)==-1) > > printf("Error on drive %c (%d)\n", drive+'A', errno); > > else > > printf("Drive %c is OK\n", drive+'A'); > > } Sorry for a late reply. I'm afraid this is simply a bug in the DJGPP docs: the libc reference says that the argument to _get_dev_info is a handle or a drive number. The latter part is incorrect: the function accepts *only* file handles. So, to get info about a disk file, you need to open a file on that disk, and then pass the handle to _get_dev_info. The strange behavior you reported is due to the fact that the function was interpreting the argument as a file handle, and thus any open handle, like those in the 0-4 range, would succeed, while the rest would fail. I'm sorry for the confusion; I just checked in a change for the next release.