home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / amiga / programm / 12551 < prev    next >
Encoding:
Internet Message Format  |  1992-08-21  |  2.7 KB

  1. Path: sparky!uunet!paladin.american.edu!darwin.sura.net!mips!swrinde!elroy.jpl.nasa.gov!jato!jdickson
  2. From: jdickson@jato.jpl.nasa.gov (Jeff Dickson)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Best way to get Device names?
  5. Message-ID: <1992Aug21.223638.24759@jato.jpl.nasa.gov>
  6. Date: 21 Aug 92 22:36:38 GMT
  7. References: <S37732V.92Aug21181213@vipunen.hut.fi>
  8. Distribution: comp.sys.amiga.programmer
  9. Organization: Jet Propulsion Laboratory
  10. Lines: 68
  11.  
  12. In article <S37732V.92Aug21181213@vipunen.hut.fi> s37732v@vipunen.hut.fi (Markus Juhani Aalto) writes:
  13. >
  14. >Hi!
  15. >
  16. >I have a little problem with my program which scans through DOS list
  17. >to get device, volume etc.. names. It's supposed to be KS2.04 or
  18. >greater code.
  19. >
  20. >Here is a piece of my code
  21. >---------------------------------
  22. >dlist = LockDosList( types );
  23. >    if( dlist ) {
  24. >        while( (dlist = NextDosEntry(dlist, types)) != NULL  ) {
  25. >            new_node = (struct Node *)AllocMem(sizeof(struct Node),
  26. >                    MEMF_ANY|MEMF_CLEAR);
  27. >            if(new_node) {
  28. >                if( SetNode_Name(new_node,dlist) == FALSE ) {
  29. >                    FreeMem((void *)new_node,sizeof(struct Node));
  30. >                    RemoveList( list );
  31. >                    UnLockDosList( types );
  32. >                    return( NULL );
  33. >                }
  34. >
  35. >                if( dlist->dol_Type == DLT_DEVICE) {
  36. >                    if( IsFileSystem( new_node->ln_Name ) == FALSE ) {
  37. >                        FreeMem((void *)new_node,sizeof(struct Node));
  38. >                    }
  39. >                    else {
  40. >                        AddNodeAlpha(list, new_node);
  41. >                    }
  42. >                }
  43. >                else {
  44. >                    AddNodeAlpha(list, new_node);
  45. >                }
  46. >            }
  47. >        }
  48. >    }
  49. >UnLockDosList( types );
  50. >
  51. >-------------------------------------------------
  52. >
  53. >Okey. So i'm scanning through list with types. And when I encounter
  54. >device (DLT_DEVICE) I check if it's something like "DF1:", "DH0:"
  55. >etc.. This filters devices like "PRT:" and "CON:". 
  56. >
  57. >Well, then comes a little problem. This IsFileSystem seems to check
  58. >devices in such a way that devices which haven't been accessed before 
  59. >now load info memory. For example
  60. >
  61. >My device list before running my code:
  62. >
  63. >   DF0:, DF1:, DH0:, DH1:, DH2:, RAM:
  64. >
  65. >and after.
  66. >
  67. >   DF0:, DF1:, DH0:, DH1:, DH2:, RAM:, DI0:, DI1:
  68. >
  69. >So how could I check devices without forcing them to load into memory?
  70. >
  71. >Thanks!
  72.  
  73.     I haven't investigated this phenomena, but new (I believe) to 2.x
  74. are Late Assignments. A possible work around would be to first check the
  75. the task field (pointer to handler message port) and if non zero, meaning
  76. the device is already in memory, send a homemade ACTION_IS_FILESYSTEM DOS
  77. packet to it. 
  78.  
  79. jeff
  80.