demo scripts
git-svn-id: file:///home/svn/incoming/trunk@2415 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
parent
9ea2b1f1c1
commit
4a41fbb4b5
|
@ -1,3 +1,5 @@
|
|||
#!/usr/bin/ruby -I../../lib
|
||||
|
||||
require 'Rex/Post'
|
||||
|
||||
netconf = false
|
||||
|
@ -122,6 +124,8 @@ end
|
|||
if (dir)
|
||||
puts "Testing dir...\n\n"
|
||||
|
||||
puts "%WINDIR% is #{client.fs.file.expand_path('%WINDIR%')}"
|
||||
|
||||
puts "Getting contents of C:\\"
|
||||
|
||||
client.fs.dir.foreach("C:\\") { |name|
|
||||
|
|
|
@ -35,6 +35,17 @@ Separator = "\\"
|
|||
return $2
|
||||
end
|
||||
|
||||
# Expands a file path
|
||||
def File.expand_path(path)
|
||||
request = Packet.create_request('stdapi_fs_file_expand_path')
|
||||
|
||||
request.add_tlv(TLV_TYPE_FILE_PATH, path)
|
||||
|
||||
response = client.send_request(request)
|
||||
|
||||
return response.get_tlv_value(TLV_TYPE_FILE_PATH)
|
||||
end
|
||||
|
||||
def File.stat(name)
|
||||
return client.fs.filestat.new(name)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue