Skip to content

Commit 3d999f1

Browse files
kernelsmithkernelsmith
authored andcommitted
add rename_file method to Msf::Post::File
Came up on IRC, I'm not attached to it, but this commit adds the rename_file method to lib/msf/core/post/file.rb and aliases it to move_file and mv_file
1 parent e6e2554 commit 3d999f1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/msf/core/post/file.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,15 @@ def rm_f(*remote_files)
298298
end
299299
end
300300

301+
#
302+
# Rename a remote file
303+
#
304+
def rename_file(new_file, old_file)
305+
write_file(new_file, (read_file(old_file))
306+
rm_f(old_file)
307+
end
308+
alias :move_file :rename_file
309+
alias :mv_file :rename_file
301310

302311
protected
303312
#

0 commit comments

Comments
 (0)