Adding hook to create non-existent directories containing a newly created file before saving.