factored some code from FileUtils to new FileSystem\ThroughTmpFileWriter module (and cleaned up and did POSIX impl)