home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: sparky!uunet!mcsun!news.funet.fi!funic!nntp.hut.fi!nntp!s37732v
- From: s37732v@vipunen.hut.fi (Markus Juhani Aalto)
- Subject: Best way to get Device names?
- Message-ID: <S37732V.92Aug21181213@vipunen.hut.fi>
- Sender: usenet@nntp.hut.fi (Usenet pseudouser id)
- Nntp-Posting-Host: vipunen.hut.fi
- Organization: Helsinki University of Technology, Finland
- Distribution: comp.sys.amiga.programmer
- Date: 21 Aug 92 18:12:13
- Lines: 70
-
-
- 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!
- --
-
-
- **************************************************************************
- * Markus Aalto | Helsinki University of Technology *
- * | *
- * EMail: s37732v@vipunen.hut.fi | Faculty of Electric Engineering *
- * Fax: 358-0-8746991 (Sometimes) | *
- * | Undergraduate in Computer Science *
- **************************************************************************
-
-