[Win32utils-devel] network drives

Berger, Daniel Daniel.Berger at qwest.com
Tue Feb 8 09:17:18 EST 2005


Hi Zach,

> -----Original Message-----
> From: win32utils-devel-bounces at rubyforge.org 
> [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of 
> Zach Dennis
> Sent: Monday, February 07, 2005 6:42 AM
> To: win32utils-devel at rubyforge.org
> Subject: [Win32utils-devel] network drives
> 
> 
> Another nicety may be handling network drives. I've been using a ruby 
> script which manipulate using the "net use" command to map network 
> drives, disconnect network drives, query to see what drives are 
> connected, etc..., but it'd be sweet if this type of 
> functionality was 
> included in win32 package.
> 
> Maybe usage like:
>    nd = Win32::NetworkDrive.new( 'v:' , 'ComputerName', 'ShareName' )
>    nd.connect( 'username' , 'password' )
>    nd.disconnect
> 
>    nd = Win32::NetworkDrive.new( 'v:' , '\\ComputerName\ShareName', 
> 'username', 'passwod' )
>    nd.connect
>    nd.disconnect
> 
>    nd = Win32::NetworkDrive.new( '\\ComputerName\ShareName' )
>    Win32::NetworkDrive.connected?( 'v:' ) => false
>    nd.connect( 'v:' )
>    nd.disconnect
> 
>    Win32::NetworkDrive.new9 '\\ComputerName\ShareName' ) do |nd|
>      Dir["#{nd}"].each { |f| puts f }
>    end
> 
> or something? What do you'all think?
> 
> Zach

That looks nice.  I'm wondering if we should have an all encompassing
"win32-drive" package that includes this and the driveinfo stuff from
Heesob.  That might make compatibility with Mike Hall's "filesystem"
package more of a pain, though.

Any thoughts?

Regards,

Dan



More information about the win32utils-devel mailing list