OXIESEC PANEL
- Current Dir:
/
/
opt
/
golang
/
1.22.0
/
src
/
io
/
ioutil
Server IP: 191.96.63.230
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/02/2024 06:09:55 PM
rwxr-xr-x
📄
example_test.go
2.66 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ioutil.go
3.18 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ioutil_test.go
3.22 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
tempfile.go
1.71 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
tempfile_test.go
5.51 KB
02/02/2024 06:09:55 PM
rw-r--r--
📁
testdata
-
02/02/2024 06:09:55 PM
rwxr-xr-x
Editing: tempfile.go
Close
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ioutil import ( "os" ) // TempFile creates a new temporary file in the directory dir, // opens the file for reading and writing, and returns the resulting *[os.File]. // The filename is generated by taking pattern and adding a random // string to the end. If pattern includes a "*", the random string // replaces the last "*". // If dir is the empty string, TempFile uses the default directory // for temporary files (see [os.TempDir]). // Multiple programs calling TempFile simultaneously // will not choose the same file. The caller can use f.Name() // to find the pathname of the file. It is the caller's responsibility // to remove the file when no longer needed. // // Deprecated: As of Go 1.17, this function simply calls [os.CreateTemp]. func TempFile(dir, pattern string) (f *os.File, err error) { return os.CreateTemp(dir, pattern) } // TempDir creates a new temporary directory in the directory dir. // The directory name is generated by taking pattern and applying a // random string to the end. If pattern includes a "*", the random string // replaces the last "*". TempDir returns the name of the new directory. // If dir is the empty string, TempDir uses the // default directory for temporary files (see [os.TempDir]). // Multiple programs calling TempDir simultaneously // will not choose the same directory. It is the caller's responsibility // to remove the directory when no longer needed. // // Deprecated: As of Go 1.17, this function simply calls [os.MkdirTemp]. func TempDir(dir, pattern string) (name string, err error) { return os.MkdirTemp(dir, pattern) }