Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!sdd.hp.com!decwrl!crltrx!decvax.dec.com!shlump.nac.dec.com!jeanne.enet.dec.com!keeler From: keeler@jeanne.enet.dec.com Newsgroups: comp.sys.ibm.pc.programmer Subject: Re: Setting Volume Label: summary, solution Keywords: Volume, Label Message-ID: <12093@shlump.nac.dec.com> Date: 31 May 90 17:34:19 GMT References: <326sis-b@massey.ac.nz> Sender: newsdaemon@shlump.nac.dec.com Reply-To: keeler@jeanne.enet.dec.com () Organization: Digital Equipment Corporation, Westford, MA Lines: 63 > From: E.Ireland@massey.ac.nz (Evan Ireland) > Newsgroups: comp.sys.ibm.pc.programmer > Subject: Setting Volume Label: summary, solution > Keywords: Volume, Label > > Other questions > --------------- > > (a) Are there any IBM PC or compatible systems with other than 512 > byte disk sectors? There is a field for sector size (in bytes) in > the boot table but I imagine a lot of software assumes 512 byte > sectors. > > (b) The root directory may contain entries for subdirectories, and the > starting cluster is given, but the file size field is always 0. > Do all subdirectory tables only contain one cluster of sectors, or > is it necessary to follow a chain of clusters in the FAT? In > other words, how do you determine the number of sectors/entries in > a subdirectory? > > (c) Has anybody else discovered the problem with TC 1.5 absread & > abswrite, and a way to get around it without disabling register > variables? I could send a small (19 line) C program demonstrating > this error to anybody who is interested. > Evan, I can't answer your first question, however in regards to the other two. Subdirectories are not like the root directory. That is there is no limit of files in them, thus you must follow the cluster chain within the FAT if you are working at that level. I also discovered the problem with TURBOC 1.5 with absread and abswrite. The following code segment was used to solve the problem in my case. I found that the only register that was corrupted was CX and thus I just saved it prior to the call and then restored it after. .................. unsigned sav_cx; #ifdef __TURBOC__ /* This code inserted to overcome bug in TurboC V1.5 */ sav_cx = _CX; #endif if (absread(drive_no,nsects,i,&diskin[0]) == -1) { errno &= 0x000D; sprintf(error_msg,"%s\n",errno,errlist[errno]); return(TRUE); } #ifdef __TURBOC__ /* This code inserted to overcome bug in TurboC V1.5 */ _CX = sav_cx; #endif Thanks for the info on the r switch I didn't even think of that. Gary root directory > sectors (# root directory entries * size of directory entry (32) / > byt