Ticket #14715: write_files.rb

File write_files.rb, 380 bytes (added by dcatt, 9 months ago)
Line 
1module WriteFiles
2
3 def write_files
4 folder = 'files'
5 Dir.chdir('/boot/home/Desktop')
6 Dir.mkdir(folder) unless File.exists?(folder)
7 100.times do |number|
8 open("./#{folder}/file#{number += 1}.txt", 'w') do |file|
9 1000000.times { file << "1234567890\n" }
10 end
11 end
12 end
13end
14
15include WriteFiles
16
17# load '/boot/home/Desktop/write_files.rb'