How will you rename and delete a file in Ruby?
Answer / Nisar Ahmad
To rename a file, you can use the File.rename method: File.rename('old_filename', 'new_filename'). To delete a file, you can use the File.delete method: File.delete('filename')
| Is This Answer Correct ? | 0 Yes | 0 No |
In how many ways you can compare Ruby string?
what is the role of sub-directory app/controllers and app/helpers?
Explain about the defined operator?
Where does a scope change in a ruby program?
How many iterators are there in ruby?
What is the use of interpolation in ruby?
What are blocks and procs?
How is visibility of methods changed in ruby?
How to check whether a directory exist or not in Ruby?
Is ruby whitespace-dependent?
What is the pattern matching operator in ruby?
Explain about variables?