rclone/vendor/github.com/calebcase/tmpfile
2020-05-12 15:56:50 +00:00
..
.golangci.yml Tardigrade Backend: Dependencies 2020-05-12 15:56:50 +00:00
doc.go Tardigrade Backend: Dependencies 2020-05-12 15:56:50 +00:00
go.mod Tardigrade Backend: Dependencies 2020-05-12 15:56:50 +00:00
go.sum Tardigrade Backend: Dependencies 2020-05-12 15:56:50 +00:00
LICENSE Tardigrade Backend: Dependencies 2020-05-12 15:56:50 +00:00
LICENSE.golang Tardigrade Backend: Dependencies 2020-05-12 15:56:50 +00:00
README.md Tardigrade Backend: Dependencies 2020-05-12 15:56:50 +00:00
tmpfile_windows.go Tardigrade Backend: Dependencies 2020-05-12 15:56:50 +00:00
tmpfile.go Tardigrade Backend: Dependencies 2020-05-12 15:56:50 +00:00

Documentation Test Status

Cross Platform Temporary Files

This library attempts to bridge the gap between the what is provided in ioutil.TempFile and the best practice of ensuring temporary files are always deleted when the application exits.

The normal way to do this on a POSIX system is to use the behavior of unlink to immediately remove the directory entry for the temporary file. The OS then ensures that when all open file handles on the file are close that the file resources are removed. Unfortunately, despite Go having os.Remove this does not work on Windows because on Windows it is necessary to open the files with special flags (FILE_SHARE_DELETE, FILE_FLAG_DELETE_ON_CLOSE) to enable removing a file that is open (and ioutil does not do this).