#2 - creating directory before trying to create file

Fixes #2.