Path: utzoo!attcan!uunet!portal!cup.portal.com!Robert_C_Tellefson From: Robert_C_Tellefson@cup.portal.com Newsgroups: comp.sys.ibm.pc Subject: Re: How do I open() DOS directories? Message-ID: <6015@cup.portal.com> Date: 28 May 88 18:26:02 GMT References: <221@h-three.UUCP> <5631@cup.portal.com> <907@parcvax.Xerox.COM> <121@chiron.UUCP> Organization: The Portal System (TM) Lines: 53 XPortal-User-Id: 1.1001.2624 It seems I jumped to an invalid conclusion based on a reasonable assumption - easy to do when working with DOS. My company produces a hard disk manager and DOS shell called JOBS (an acronym for Job Organization and Backup System). We use FCB's to create/rename disk volume labels and to rename directories. These functions can not be accomplished using DOS file handles. Examples: We create a disk label by creating a file with a volume label attribute and then close it (using DOS functions 16h & 10h). We rename directories using FCB's and function 17h. These old FCB functions are the only way to perform these operations in a DOS compatible way, IE., directories can not be renamed using the Change Directory Entry function (56h). My error was to assume that DOS would support the other FCB functions as well. After these many years with DOS, I should know better than to assume anything. I tested the other function calls and it seems none of the other FCB functions can be applied to a directory entry with an attribute of 10h, the attribute given to subdirectories. Directories are just files allocated space one cluster at a time. With proper DOS support they could be read into memory and treated as ordinary data. As it is, the only way to accomplish this is to use interrupts 25h & 26h (absolute disk read/write) to get a directory's cluster assignment and then translate (using the File Allocation Table) to a physical cluster address followed by an absolute disk read of that cluster or possibly clusters. Int 25h & 26h access is used by a number of popular disk managers. I agree with Jon L. Griffeth when he says that is unwise to go around DOS to access directories directly. JOBS is 100% DOS & BIOS compatible and one benefit of that is its ability to be used on Unix partitions (under DOS-merge or the like) without modification. Try that with Qdos or other programs that use direct knowledge of a disk's layout! Information about JOBS' Sharware version and JOBS+ (not Shareware) is available upon request. Bob Tellefson uucp: tellefson@cup.portal.com RCT Design Compuserve: 73417,545 Genie: R.TELLEFSON Voice: (408) 749-9826 USPS: 663 S. Bernardo #7 Sunnyvale, CA 94087 ---------------------------------------------------------------------- I began with nothing and I still have most of it.