New bins, new functions, more info soon

git-svn-id: file:///home/svn/framework3/trunk@13059 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
HD Moore 2011-06-29 06:12:03 +00:00
parent afbf445a87
commit 92bb531af5
17 changed files with 41 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -90,6 +90,47 @@ Separator = "\\"
return response.get_tlv_value(TLV_TYPE_FILE_PATH)
end
#
# Calculates the MD5 (16-bytes raw) of a remote file
#
def File.md5(path)
request = Packet.create_request('stdapi_fs_md5')
request.add_tlv(TLV_TYPE_FILE_PATH, path)
response = client.send_request(request)
return response.get_tlv_value(TLV_TYPE_FILE_NAME)
end
#
# Calculates the SHA1 (20-bytes raw) of a remote file
#
def File.sha1(path)
request = Packet.create_request('stdapi_fs_sha1')
request.add_tlv(TLV_TYPE_FILE_PATH, path)
response = client.send_request(request)
return response.get_tlv_value(TLV_TYPE_FILE_NAME)
end
#
# Expands a file path, substituting all environment variables, such as
# %TEMP%.
#
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
#
# Performs a stat on a file and returns a FileStat instance.
#