🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

<<WARNING to DESK ACC Creators>>

#2752
From: Kenneth Soohoo
Date: Tue, 01 Aug 1989 18:25
42 lines
1679 bytes
TO ANYONE DEVELOPING DESK ACCESSORIES:

Don't use Fsfirst()/Fsnext() without first setting the DTA to your own local
buffer area using Fgetdta() and Fsetdta()!!!!!!!!

If you're a Desk Acc, you'll be overwriting the desktop's DTA, and you
never know what that can do to your desktop...

Now, once you're done with your Fsfirst() and Fsnext()ing, be sure to
restore the DTA to it's old value!!! That _too_ can cause problems...

SAMPLE CODE:
(Using MWC 3.0.6 Bindings. In some compilers "DMABUFFER" is "DTA".
 In any case, it's a 44 byte buffer that contains usefull info about
 file searches.)

	int 		err;
	DMABUFFER	*oldbuff, newbuff;

	oldbuff = Fgetdta();		/* Save old DTA for later */
	Fsetdta(&newbuff);		/* Tell GEMDOS about OUR buff */

	/*	
		Insert Fsfirst() and Fsnext() calls here...

		err = Fsfirst("*.*", 0);	/* First DTA fill */
		while (err == E_OK) {
			/* Process DTA */
			err = Fsnext();		/* Fill DTA again */
			}
	*/

	Fsetdta(oldbuff);		/* Restore for desktop's use */


Hope this helps...

-- 
Ken Soohoo			{ames,imagen,portal}!atari!kens
Atari (U.S.) Engineering
>> The Opinions Expressed above are _MINE_, _NOT_ Atari's. <<
Technical Details
Message-ID: <1632@atari.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!apple!sun-barr!newstop!sun!imagen!atari!kens

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!apple!sun-barr!newstop!sun!imagen!atari!kens
From: kens@atari.UUCP (Kenneth Soohoo)
Newsgroups: comp.sys.atari.st
Subject: <<WARNING to DESK ACC Creators>>
Keywords: Fsfirst(),Fsnext(),Fgetdta(),Fsetdta(),DTA
Message-ID: <1632@atari.UUCP>
Date: 1 Aug 89 18:25:46 GMT
Reply-To: kens@atari.UUCP (Kenneth Soohoo)
Organization: Atari (US) Corporation, Sunnyvale, California
Lines: 42