To rename a file or folder in Ruby you can use the following snippet.
Sample Ruby
begin
File.rename("/path/to/oldfile", "/path/to/newfile")
rescue Exception => e
# the exception your way
end
All the Code Snippets and Samples you need
To rename a file or folder in Ruby you can use the following snippet.
begin
File.rename("/path/to/oldfile", "/path/to/newfile")
rescue Exception => e
# the exception your way
end
You must be logged in to post a comment.
RT @CodeSnippetsNET: How to rename a file or folder in #Ruby http://t.co/iFDF6tCl6r #programming #coding #code #dev #develop
RT @CodeSnippetsNET: How to rename a file or folder in #Ruby http://t.co/iFDF6tCl6r #programming #coding #code #dev #develop