Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!hsi!genly!chris From: chris@genly.UUCP (Chris Hind Genly) Newsgroups: comp.sys.amiga.tech Subject: Finding disk names Message-ID: Date: 14 Nov 90 17:47:34 GMT Organization: Eggplant Software Tools, CT, USA Lines: 43 I would like to find the names of disks available on a system. Currently I'm looking through the DevInfo list. The disk names are there. By looking at dol_Type, I can determine if the entry is for a device or not. The problem is how to figure out if it's a disk or not. Right now I look for a startup message, and examine it to see if it looks like a disk startup message. I'm not happy with this method. It doesn't find the ram disk, and it may find a device which is not a disk. Anybody have any suggestions? Here's what I'm doing now. RootNode = (struct RootNode *)DOSBase->dl_Root; DosInfo = (struct DosInfo *)BADDR(RootNode->rn_Info); Devices = (struct DosList *)BADDR(DosInfo->di_DevInfo); for(Device = Devices; Device; Device = (struct DosList *)BADDR(Device->dol_Next)) { if (Device->dol_Type == DLT_DEVICE && (Startup = (struct FileSysStartupMsg *) BADDR(Device->dol_misc.dol_handler.dol_Startup)) && (DosEnvec = (struct DosEnvec *)BADDR(Startup->fssm_Environ)) && DosEnvec->de_Surfaces < 20 && DosEnvec->de_Surfaces > 0) ; else ; Name = (char *)BADDR(Device->dol_Name); Name++; printf("%08x: %d %s\n", Device, Device->dol_Type, Name); } * * * \|/ * _______ --O-- ____/ KC1VP \____ * /|\ * _____________/ (203) 389-8680 \_______________ ______/ 95 Fountain Terr., New Haven, CT, USA, 06515 \_______ / Chris Hind Genly chris@genly.uucp uunet!hsi!genly!chris \ ----------------------------------------------------------------