before creating file, creating directory if it doesn't exist
Merge branch 'create-directory-if-does-not-exist'