lib/rbvmomi/vim/Datastore.rb
# Find all files in a datastore path
# @param path (optional) [String] Path to search for file under
# @return [Array] of files found
Find all files in a datastore path
Find all files in a datastore path
def files_in_dir path = nil
    if path.nil?
      ds_path = "[#{self.info.name}]"
    else
      ds_path = "[#{self.info.name}] #{path}"
    end
    query_spec = file_query_spec
    result = self.browser.SearchDatastore_Task(:datastorePath => ds_path, :searchSpec => query_spec).wait_for_completion
    unless result.is_a? Array
      result = [*result]
    end
    result
  end
def files_in_dir path = nil if path . nil? ds_path = "[#{self.info.name}]" else ds_path = "[#{self.info.name}] #{path}" end query_spec = file_query_spec result = self . browser . SearchDatastore_Task ( :datastorePath => ds_path , :searchSpec => query_spec ) . wait_for_completion unless result . is_a? Array result = [ * result ] end result end
Find all files in a datastore path
Find all files in a datastore path
of files found
of files found
Array
path
(optional)  Path to search for file under
( optional ) Path to search for file under