Skip to content

Instantly share code, notes, and snippets.



Created Oct 8, 2011
What would you like to do?
write a file in a directory that may not exist
require 'fileutils'
def deep_write(f, data)
FileUtils.mkdir_p(File.dirname(f)) unless, 'w').write(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.