str = Dir.mkdir("directory") txt = File.open("directory/a.txt","w+") txt.puts("hello world") txt.close