Ruby/File Directory/delete
Материал из Wiki.crossplatform.ru
Версия от 17:57, 13 сентября 2010; ViGOur (Обсуждение | вклад)
Change file mode and then delete it
file = File.new( "books.txt", "w" ) file.chmod( 0755 ) system "ls -l books.txt" File.delete( "books.txt" )
delete either one file at a time or many at once
File.delete("file1.txt") File.delete("file2.txt", "file3.txt", "file4.txt") File.unlink("file1.txt")
Deleting and Renaming Files
File.new( "books.txt", "w" ) File.rename( "books.txt", "chaps.txt" ) File.delete( "chaps.txt" )