# class Chef::Util::Windows::Volume

### Constants

DeleteVolumeMountPoint

  XXX not defined in the current windows-pr release

### Public Class Methods

new(name) click to toggle source

    # File lib/chef/util/windows/volume.rb, line 34
    def initialize(name)
      name += "\\" unless name =~ /\$/ #trailing slash required
      @name = name
    end

### Public Instance Methods

add(args) click to toggle source

    # File lib/chef/util/windows/volume.rb, line 54
    def add(args)
      unless SetVolumeMountPoint(@name, args[:remote])
        raise ArgumentError, get_last_error
      end
    end

delete() click to toggle source

    # File lib/chef/util/windows/volume.rb, line 48
    def delete
      unless DeleteVolumeMountPoint.call(@name)
        raise ArgumentError, get_last_error
      end
    end

device() click to toggle source

    # File lib/chef/util/windows/volume.rb, line 39
    def device
      buffer = 0.chr * 256
      if GetVolumeNameForVolumeMountPoint(@name, buffer, buffer.size)
        return buffer[0,buffer.size].unpack("Z*")[0]
      else
        raise ArgumentError, get_last_error
      end
    end