xern has asked for the wisdom of the Perl Monks concerning the following question:

Hi, Does anyone know the answer how to safely detach a USB drive on Win32? My task is to send/receive files over multiple ftp servers with a USB disk. I don't want to detach the drive manually and hope perl can help me automate this job. Does anyone have the solution? Thank you
  • Comment on Detach USB drives using perl on Win32 platform

Replies are listed 'Best First'.
Re: Detach USB drives using perl on Win32 platform
by marto (Cardinal) on Nov 11, 2005 at 16:14 UTC
    Hi xern,

    I dont know of any modules that will do this. Microsoft provide DevCon, a command line tool which may be able to help you with this. Check out the documentation, you may be able to use this in conjunction with your Perl script to achieve what you need.

    Hope this helps

    Martin
Re: Detach USB drives using perl on Win32 platform
by holli (Abbot) on Nov 12, 2005 at 05:28 UTC
    This is not really a perl problem. The real problem is which WINAPI funtions you have to call or which messages you have to send to get the OS to do what you want. Once you know that, implementing in perl will become trivial.


    holli, /regexed monk/