Change the filename quoting a bit, create requested working directories when needed