Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.unix.wizards Subject: Re: getcwd & A question on disk accessing Message-ID: <6521@brl-smoke.ARPA> Date: Mon, 5-Oct-87 18:35:08 EDT Article-I.D.: brl-smok.6521 Posted: Mon Oct 5 18:35:08 1987 Date-Received: Thu, 8-Oct-87 05:42:46 EDT References: <225@stag.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 24 In article <225@stag.UUCP> trb@stag.UUCP ( Todd Burkey ) writes: >... The big question is...can I scan a file >system on unix like I did on the ST? Basically, on the ST, I did raw >sector I/O on the FAT table area of the hard disk, recursively working >my way through the data pulling in new FAT table sectors when needed. >Sounds messy, but I personally don't like using 'standard' file access >calls if said calls take 10-50 times as long as a short routine that >bypasses them in some way. I realize that this may mean that only sys >admins may end up being able to use my program on Unix systems (file >security issues will probably require this), but that is ok since I >think the sys admins would get the most practical use out of it. Yes, if you can read the raw disk device file, you can interpret the information as you see fit, including duplicating all the UNIX kernel support for the file system structure. However, I don't recommend bypassing the kernel like this, because you would end up with a filesystem-specific utility, and porting it to other UNIX filesystems could be a drag. Indeed, UNIX System V Release 3.0 and later provide the hooks for multiple concurrent file system formats, and there are also systems such as NFS where the only meaningful information is that obtained with the help of the kernel (e.g. getdirentries()). But if you nonetheless wish to proceed with the original idea, your best bet is to obtain the source for "fsdb" or at least "fsck" for your system and use that as a guide to interpreting the filesystem data structures.