Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site noscvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!vax135!cornell!uw-beaver!tektronix!hplabs!sdcrdcf!sdcsvax!noscvax!johnson From: johnson@noscvax.UUCP (Timothy A. Johnson) Newsgroups: net.micro.pc Subject: Re: MS-DOS function 4Eh problem! Message-ID: <1084@noscvax.UUCP> Date: Mon, 26-Aug-85 17:49:48 EDT Article-I.D.: noscvax.1084 Posted: Mon Aug 26 17:49:48 1985 Date-Received: Sat, 31-Aug-85 04:47:52 EDT References: <1106@pucc-i> <2388@watcgl.UUCP> Organization: Naval Ocean Systems Center, San Diego Lines: 34 > > I am writing a program in which, among other things, I would like to > be able to read (and set or alter) disk's Volume-ID label. I was hoping that > I could use MS-DOS function call 4Eh to obtain the v-id label with attribute > byte set to 08 and the pathname set to *.*. To my surprise, 4E would return > the file name (and the rest) of the first file on the disk regardless of the > file attribute. In fact it seems that 4E function does not try to mach file > attribute as it is documented in the MS-DOS manual since most files have the > byte attribute of 20h and no matter to what value the CX register is set, 4E > only maches the pathname. > > Am I not interpreting documentation correctly or is this a bug? BTW, > program is written in Turbo Pascal 3.0 and running on Pronto Series 16 with > MS-DOS 2.0. Also, I am aware of the alternate ways to do it (use absolute > disk read interrupt 25h to get the directory sectors and manipulate them > "manually"). > I have come across this problem, also. I believe it is a bug in DOS versions prior to 3.0 (or at least 3.1). Calling function 4EH with *.* or ????????.??? and the attribute mask of 8 is correct. However, if the label happens to be the first non-deleted directory entry (in the root, of course), it will not be found. The function works as expected when at least one non-deleted file entry exists in the directory prior to the label entry. I found this to be true on both a Zenith Z-150 under MS-DOS 2.11 and an IBM PC under PC-DOS 2.1. When I tried the same program with an IBM PC and PC-DOS 3.1, it always found the label no matter where it was in the root directory. BTW: I suspect that using '*' as the file name mask is not sufficient since the label can have up to 11 characters and trailing three characters are stored in the same place as a normal file's extension. Tim Johnson Computer Sciences Corporation