Deleting and Renaming Files : delete « File Directory « Ruby






Deleting and Renaming Files


File.new( "books.txt", "w" )
File.rename( "books.txt", "chaps.txt" )
File.delete( "chaps.txt" )

 








Related examples in the same category

1.delete either one file at a time or many at once
2.Change file mode and then delete it