Listing available drives for windows

// Expert user has replied.
B Brandt Wijbenga 3 years ago
2 1 0

Hi,

We're trying to add some minor file browsing capabilities to our app. This works nicely using the native ruby File/Dir operations.
As an extra, for a windows desktop build we want to add another layer that lists all available drives. This should be possible by using the 'win32ole' library:

Example snippet:

require 'win32ole'
def get_drives_listing
  result = []
  WIN32OLE.new( "Scripting.FileSystemObject" ).Drives.each do |drive|
    result drive.Path } if drive.IsReady
  end
  result
end

However, this library is not included when deploying the app, so attempting to run it after adding "require 'win32ole'" doesn't work.
Is there any way to include this properly? Or might there be a default Rho layer/directive to achieve this? (We're currently running Rho version 4.1.27)

Any help would be appreciated.

CONTACT
Can’t find what you’re looking for?