1234567891011121314 |
- #!/usr/bin/ruby
- #
- ## https://rosettacode.org/wiki/Rename_a_file
- #
- # Here
- File.rename('input.txt', 'output.txt');
- File.rename('docs', 'mydocs');
-
- # Root dir
- File.rename(Dir.root + %f'input.txt', Dir.root + %f'output.txt');
- File.rename(Dir.root + %f'docs', Dir.root + %f'mydocs');
|