Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!necntc!ames!amdcad!sun!pepper!cmcmanis From: cmcmanis%pepper@Sun.COM (Chuck McManis) Newsgroups: comp.sys.amiga Subject: Re: Assign Message-ID: <31019@sun.uucp> Date: Thu, 15-Oct-87 16:03:14 EDT Article-I.D.: sun.31019 Posted: Thu Oct 15 16:03:14 1987 Date-Received: Sat, 17-Oct-87 09:21:12 EDT References: <15590@amdahl.amdahl.com> <2460@cbmvax.UUCP> <1799@cadovax.UUCP> Sender: news@sun.uucp Reply-To: cmcmanis@sun.UUCP (Chuck McManis) Organization: Sun Microsystems, Mountain View Lines: 33 In article <1799@cadovax.UUCP> keithd@cadovax.UUCP (Keith Doyle) writes: > >Hi gang, >Does anyone out there have any idea how to find out (from 'C') >if something in particular is in the 'Assign' table? I want to >find out if a file exists using an Assign foo: wherever, and by >referencing the file as foo:filename. If either the file does >not exist, or the foo: has never been assigned, is what I want >to find out from my program. Unfortunately, if foo: has not >been assigned, what I get is a requester that says 'insert >foo: in any drive' which is not what I want. If it is not >in the Assign table, I want to assume that it does not >exist. Yes, I have an idea on how it works. :-) Actually, assignments are stored in the link list of DeviceList structures that are pointed to by DevInfo in the root structure. Assigns have type DLT_DIRECTORY, there are also entries for devices (DLT_DEVICE) and volumes (DLT_VOLUME). Look at the code in my Assign.c program on Fish Disk 52, or the 'Assigned' program source on disk 66. Note that the assign.c on 52 does not do memory allocations correctly and therefore conflicts with the 'real' assign command. That has been fixed in the arp version, basically DOS puts the length of a memory allocation as a long word in front of the block of memory. My original assign did not do this. So for references see the include file for the DeviceList struct and for the root structure definition. The manual AmigaDOS Technical Reference has a discussion on how to find the root node, or you can use the code in assign.c. --Chuck McManis uucp: {anywhere}!sun!cmcmanis BIX: cmcmanis ARPAnet: cmcmanis@sun.com These opinions are my own and no one elses, but you knew that didn't you.