🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #3357

Re: Opening dos.library in C

#3357
From: Daniel S. Riley
Date: Sat, 14 Apr 1990 14:56
24 lines
1666 bytes
In article <DEVEN.90Apr12045600@netserv2.rpi.edu> deven@rpi.edu (Deven T. Corzine) writes:
>Jesper> Apart from it being a bad idea, I don't know if opening a
>Jesper> library twice will cause the machine to crash.
>
>Bad idea??  Better to open the library twice than not at all.  Cause a
>crash?  If it does, it's not due to opening it twice.

Two (obvious) things you don't want to do when you might be opening a
library twice:

1)  Don't zero the library base after the inner CloseLibrary()...clearing
    the pointer will either screw up the outer CloseLibrary() (maybe
    crashing your Amiga), or you'll end up with the library permanently
    opened.

2)  Don't make any typos.  If you set DOSBase = OpenLibrary("ods.library",0);,
    you effectively zero DOSBase for that process, and your next attempt
    at any sort of io will crash (including printing the error message
    telling the user that dos.library couldn't be opened).

See, I said they were obvious...guess I'm just feeling obvious today.

-Dan Riley (riley@tcgould.tn.cornell.edu, cornell!batcomputer!riley)
-Wilson Lab, Cornell University
Technical Details
Message-ID: <10109@batcomputer.tn.cornell.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!uwm.edu!zaphod.mps.ohio-state.edu!rpi!batcomputer!riley
References: <6287@star.cs.vu.nl> <205@mtiame.oz> <DEVEN.90Apr12045600@netserv2.rpi.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!uwm.edu!zaphod.mps.ohio-state.edu!rpi!batcomputer!riley
From: riley@batcomputer.tn.cornell.edu (Daniel S. Riley)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Opening dos.library in C
Message-ID: <10109@batcomputer.tn.cornell.edu>
Date: 14 Apr 90 14:56:53 GMT
References: <6287@star.cs.vu.nl> <205@mtiame.oz> <DEVEN.90Apr12045600@netserv2.rpi.edu>
Reply-To: riley@tcgould.tn.cornell.edu (Daniel S. Riley)
Organization: Cornell Theory Center, Cornell University, Ithaca NY
Lines: 24