mirror of
https://github.com/rclone/rclone.git
synced 2025-12-17 08:43:19 +00:00
Tardigrade Backend: Dependencies
This commit is contained in:
committed by
Nick Craig-Wood
parent
962fbc8257
commit
03b629064a
25
vendor/github.com/calebcase/tmpfile/tmpfile.go
generated
vendored
Normal file
25
vendor/github.com/calebcase/tmpfile/tmpfile.go
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
// +build !windows
|
||||
|
||||
package tmpfile
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
)
|
||||
|
||||
// New creates a new temporary file in the directory dir using ioutil.TempFile
|
||||
// and then unlinks the file with os.Remove to ensure the file is deleted when
|
||||
// the calling process exists.
|
||||
func New(dir, pattern string) (f *os.File, err error) {
|
||||
f, err = ioutil.TempFile(dir, pattern)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = os.Remove(f.Name())
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user