f10c50958c
Migrating these functions to allow them being shared between moby, docker/cli,
and containerd, and to allow using them without importing all of sys / system,
which (in containerd) also depends on hcsshim and more.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 509f19f611
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
35 lines
925 B
Go
35 lines
925 B
Go
package system
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/moby/sys/sequential"
|
|
)
|
|
|
|
// CreateSequential is deprecated.
|
|
//
|
|
// Deprecated: use os.Create or github.com/moby/sys/sequential.Create()
|
|
func CreateSequential(name string) (*os.File, error) {
|
|
return sequential.Create(name)
|
|
}
|
|
|
|
// OpenSequential is deprecated.
|
|
//
|
|
// Deprecated: use os.Open or github.com/moby/sys/sequential.Open
|
|
func OpenSequential(name string) (*os.File, error) {
|
|
return sequential.Open(name)
|
|
}
|
|
|
|
// OpenFileSequential is deprecated.
|
|
//
|
|
// Deprecated: use github.com/moby/sys/sequential.OpenFile()
|
|
func OpenFileSequential(name string, flag int, perm os.FileMode) (*os.File, error) {
|
|
return sequential.OpenFile(name, flag, perm)
|
|
}
|
|
|
|
// TempFileSequential is deprecated.
|
|
//
|
|
// Deprecated: use os.CreateTemp or github.com/moby/sys/sequential.CreateTemp
|
|
func TempFileSequential(dir, prefix string) (f *os.File, err error) {
|
|
return sequential.CreateTemp(dir, prefix)
|
|
}
|