RUBY: Creating dynamic directory in ruby

system()  method executes any commands that we can able to execute through terminal or konsole(console).

e.g
folder = "/tmp"
system("mkdir #{folder}") if !File.directory?(folder)

If you found any errors in the above coding , try to include the ftools library.

e.g
require 'ftools'
folder = "/tmp"
system("mkdir #{folder}") if !File.directory?(folder)

No comments:

Post a Comment