🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.atari.st
Article #4574

Fsfirst and error codes

#4574
From: Allan Pratt
Date: Wed, 04 Oct 1989 18:00
34 lines
2362 bytes
neubauer@tubsibr.uucp (Frank Neubauer) writes:
>apratt@atari.UUCP (Allan Pratt) writes:
>>Old TOS put pointers to its directory tree in the DTA after Fsfirst
>>or Fsnext, but TOS 1.4 does not.  You can do as many Fsfirst calls
>>as you like; no OS resources are tied up after the call.
>
>What exactly does TOS store in the DTA?  If it is information pointing to
>the disk, how does TOS know it is still valid when Fsnext is called?
>(The directory might have been deleted and the cluster reused in the
>meantime...)  What error codes must be expected?

You pays yer money and you takes yer chances.  The semantics of the DTA
mean you can't be sure of anything.  If each process had a dedicated
place where Fsfirst-type information was kept, the OS could invalidate
it or update it or whatever.  As it stands, Fsfirst/Fsnext is a big
lose.  Basically, you shouldn't do any file or directory
creation/deletion  calls and assume your DTA is still worth anything.

The last question, however, gives me a chance to address something I've
been noticing lately: people expecting only CERTAIN error codes from
certain calls.  ANY (long) NEGATIVE VALUE returned from GEMDOS
indicates an error.  Don't just check against the error codes you
"expect" -- check for ANY negative value.  If you don't, your program
won't work when we change GEMDOS for something like a network: what if
you didn't "expect" to get "EFLOCKED" (file is locked)?

You can certainly report errors any way you want, and a different
message for each error is not a bad idea, but you must be sure to treat
any negative value as an error -- the "unknown error" alert is better
than proceeding like there wasn't an error at all.

============================================
Opinions expressed above do not necessarily	-- Allan Pratt, Atari Corp.
reflect those of Atari Corp. or anyone else.	  ...ames!atari!apratt
Technical Details
Message-ID: <1718@atari.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!apple!sun-barr!newstop!sun!imagen!atari!apratt
References: <258@nikhefh.nikhef.nl> <1698@atari.UUCP> <1989Oct2.200542.8585@tubsibr.uucp>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!apple!sun-barr!newstop!sun!imagen!atari!apratt
From: apratt@atari.UUCP (Allan Pratt)
Newsgroups: comp.sys.atari.st
Subject: Fsfirst and error codes
Message-ID: <1718@atari.UUCP>
Date: 4 Oct 89 18:00:25 GMT
References: <258@nikhefh.nikhef.nl> <1698@atari.UUCP> <1989Oct2.200542.8585@tubsibr.uucp>
Organization: Atari Corp., Sunnyvale CA
Lines: 34