home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!paladin.american.edu!darwin.sura.net!mips!swrinde!elroy.jpl.nasa.gov!jato!jdickson
- From: jdickson@jato.jpl.nasa.gov (Jeff Dickson)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Best way to get Device names?
- Message-ID: <1992Aug21.223638.24759@jato.jpl.nasa.gov>
- Date: 21 Aug 92 22:36:38 GMT
- References: <S37732V.92Aug21181213@vipunen.hut.fi>
- Distribution: comp.sys.amiga.programmer
- Organization: Jet Propulsion Laboratory
- Lines: 68
-
- In article <S37732V.92Aug21181213@vipunen.hut.fi> s37732v@vipunen.hut.fi (Markus Juhani Aalto) writes:
- >
- >Hi!
- >
- >I have a little problem with my program which scans through DOS list
- >to get device, volume etc.. names. It's supposed to be KS2.04 or
- >greater code.
- >
- >Here is a piece of my code
- >---------------------------------
- >dlist = LockDosList( types );
- > if( dlist ) {
- > while( (dlist = NextDosEntry(dlist, types)) != NULL ) {
- > new_node = (struct Node *)AllocMem(sizeof(struct Node),
- > MEMF_ANY|MEMF_CLEAR);
- > if(new_node) {
- > if( SetNode_Name(new_node,dlist) == FALSE ) {
- > FreeMem((void *)new_node,sizeof(struct Node));
- > RemoveList( list );
- > UnLockDosList( types );
- > return( NULL );
- > }
- >
- > if( dlist->dol_Type == DLT_DEVICE) {
- > if( IsFileSystem( new_node->ln_Name ) == FALSE ) {
- > FreeMem((void *)new_node,sizeof(struct Node));
- > }
- > else {
- > AddNodeAlpha(list, new_node);
- > }
- > }
- > else {
- > AddNodeAlpha(list, new_node);
- > }
- > }
- > }
- > }
- >UnLockDosList( types );
- >
- >-------------------------------------------------
- >
- >Okey. So i'm scanning through list with types. And when I encounter
- >device (DLT_DEVICE) I check if it's something like "DF1:", "DH0:"
- >etc.. This filters devices like "PRT:" and "CON:".
- >
- >Well, then comes a little problem. This IsFileSystem seems to check
- >devices in such a way that devices which haven't been accessed before
- >now load info memory. For example
- >
- >My device list before running my code:
- >
- > DF0:, DF1:, DH0:, DH1:, DH2:, RAM:
- >
- >and after.
- >
- > DF0:, DF1:, DH0:, DH1:, DH2:, RAM:, DI0:, DI1:
- >
- >So how could I check devices without forcing them to load into memory?
- >
- >Thanks!
-
- I haven't investigated this phenomena, but new (I believe) to 2.x
- are Late Assignments. A possible work around would be to first check the
- the task field (pointer to handler message port) and if non zero, meaning
- the device is already in memory, send a homemade ACTION_IS_FILESYSTEM DOS
- packet to it.
-
- jeff
-