create diretory where none exists, before writing direct