Re: [WIN] GetLogicalDrives returns drives NOT present

new topic     » goto parent     » topic index » view thread      » older message » newer message

Dan Moyer wrote:
> 
> Bernie Ryan wrote:
> > 
> > Dan Moyer wrote:
> > > 
> > > 
> > > When I wrap the function GetLogicalDrives, it works, except that it 
> > > returns drive numbers for drives that aren't actually there yet, exactly
> > > as
> > > "My Computer" does, ie, usb drives that aren't currently plugged in.  And
> > > then
> > > if I use "dir" to see if a drive is "ready", I get a non-fatal error
> > > message.
> > >  
> > > 
> > > What I was trying to do was find out what drives are on the system, and
> > > then
> > > if they were removable or not.  But I don't want to check drives that
> > > aren't
> > > actually there.
> > > 
> > > Any suggestions??
> >  
> > Dan:
> > 
> >     Be sure that you unmount the USB drives before you remove them.
> > 
> >     Windows when it loads assigns the drive numbers when it boots
> > 
> >     and when you remove a USB drive it's drive number does not go
> > 
> >     away.
> > 
> >     You did't say what operating system you are using which may make a
> > 
> >     difference.
> > 
> >     Here is a link that might help:
> > 
> >     <a
> >     href="http://www.uwe-sieber.de/usbstick_e.html">http://www.uwe-sieber.de/usbstick_e.html</a>
> > 
> > Bernie
> 
> Thanks for the observation & link Bernie.
> 
> I'm using WinXP, and 4 different "removable drives" have shown up as present,
> as far as I remember, from first time I turned on the system, before ever
> mounting
> any usb flashdrives.  Those are the drives that show up from GetLogicalDrives.
> Any time I mount a usb drive, I unmount it via the "safely remove hardware"
> icon in systray, which is currently showing those same 4 not actually present
> drives; when I do mount a usb flash drive, it shows up also, and then
> dissappears
> from the "safely remove hardware" list after I click there to unmount it.  
> 
> So my problem *seems* (?) to be, how to discern if a drive that is asserted
> 
> by the system to be "there" is actually "ready" or not.  I thought to use 
> "dir" to test that, but it brought up non-fatal errors which required user
> clicks in a message box to continue, which is not desireable. 
> 

Dan:

  Get a list of drive drive letters using a Window function.
 
  Then I don't know if XP would allow you to write in Euphoria Assembler
  
  function that would use interrupt 13 ( INT 13,1 - Disk Status ) to

  check the status of each of the drive letters that you found with

  the windows function.

  Using the interrupt would eliminate the OS error message.

Bernie

My files in archive:
WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API 

Can be downloaded here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu