fromTmpFile function, usual mkdir call is only working for file's parent directory. Does not care upper parent folders. I added a recursive function that creates parent non-existing folders with usual mkdir.