Any idea why you give this error? No such file or directory @ dir_initialize - /lib/oc/
I have several txt files in that folder my code reads any .txt file and then I use it to analyze it.
Dir.foreach('/lib/oc/') do |item|
next unless File.extname(item) == '.txt'
next if File.directory? item
file = File.read(item)
File.delete(item) if File.exist?(item)
end