Article View: comp.sys.amiga.tech
Article #12558Re: InfoData->id_VolumeNode->ln_Name ??
From: Michael Stilson
Date: Tue, 09 May 1989 05:03
Date: Tue, 09 May 1989 05:03
63 lines
2507 bytes
2507 bytes
In article: <24171@agate.BERKELY.EDU> c60c-1ea@WEB.Berkely.Edu writes:
>In article <0285.AA0285@recondo> sirius@recondo.UUCP (Michael Stilson) writes:
>>Subject: Re: InfoData->id_VolumeNode->ln_Name ??
> ^
> As far as I know, id_VolumeNode points (via BCPL conventions) to a
>DeviceNode structure, not an exec Node structure. You're undoubtedly going
>to the wrong place with your dereferencing. I'm suprised you never Guru'd
>with 000...003.xxx...xxx ... :-)
Maybe it felt sorry for me.. I had 12 Software Error-Task Held's on the screen
at once today.. Although it DID cause Gomf to yell a little bit now & again.
(I did do the proper casting, etc.. and I WILL say the results were..
Interesting, to say the least.. :-)
I started doing it through a DosNode, but (at the time) it seemed to me that
it could be found from the InfoData pointer, rather than having to incorporate
yet another structure..
Here's the section of code that gets the name of the volume. If anyone knows
a better way, feel free to suggest it.
----
#define B_TO_C(cast,var) ((struct cast *)(BADDR((ULONG)var)))
char *GetName(Var)
struct Variables *Var;
{
Forbid();
Var->lock = B_TO_C(FileLock, Var->mylock);
Var->dev = B_TO_C(DeviceList, Var->lock->fl_Volume);
Var->temp = (char *)BADDR(Var->dev->dl_Name);
strncpy(Var->name, &Var->temp[1], Var->temp[0]);
Var->name[Var->temp[0]] = NULL;
Permit();
return(Var->name);
}
----
That's how I tried it first, and it worked... Then I decided to start messing
with success...
>>... or am I missing something really obvious here?
> Yes.
Somehow, I find that very easy to believe :)
Thanks... Mike.
--
--
Mike 'Sirius' Stilson - Sirius Software
sirius@recondo.UUCP
..!uunet!recondo!sirius
(412) 793-1242 or (412) 793-5765
USNail:
1312 Universal Rd. Penn Hills, PA 15235-3936
Technical Details
Message-ID:
<0363.AA0363@recondo>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!recondo!siriusReferences:
<0285.AA0285@recondo> <24171@agate.BERKELY.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!recondo!sirius From: sirius@recondo.UUCP (Michael Stilson) Newsgroups: comp.sys.amiga.tech Subject: Re: InfoData->id_VolumeNode->ln_Name ?? Message-ID: <0363.AA0363@recondo> Date: 9 May 89 05:03:17 GMT References: <0285.AA0285@recondo> <24171@agate.BERKELY.EDU> Distribution: usa Organization: Is the Root of All Evil. Lines: 63