sequential

package module
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2022 License: Apache-2.0 Imports: 1 Imported by: 146

Documentation

Overview

Package sequential provides a set of functions for managing sequential files on Windows.

The origin of these functions are the golang OS and windows packages, slightly modified to only cope with files, not directories due to the specific use case.

The alteration is to allow a file on Windows to be opened with FILE_FLAG_SEQUENTIAL_SCAN (particular for docker load), to avoid eating the standby list, particularly when accessing large files such as layer.tar.

For non-Windows platforms, the package provides wrappers for the equivalents in the os packages. They are passthrough on Unix platforms, and only relevant on Windows.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(name string) (*os.File, error)

Create creates the named file with mode 0666 (before umask), truncating it if it already exists. If successful, methods on the returned File can be used for I/O; the associated file descriptor has mode O_RDWR. If there is an error, it will be of type *PathError.

func CreateTemp

func CreateTemp(dir, prefix string) (f *os.File, err error)

CreateTemp creates a new temporary file in the directory dir with a name beginning with prefix, opens the file for reading and writing, and returns the resulting *os.File. 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.

func Open

func Open(name string) (*os.File, error)

Open opens the named file for reading. If successful, methods on the returned file can be used for reading; the associated file descriptor has mode O_RDONLY. If there is an error, it will be of type *PathError.

func OpenFile

func OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)

OpenFile is the generalized open call; most users will use Open or Create instead. It opens the named file with specified flag (O_RDONLY etc.) and perm, (0666 etc.) if applicable. If successful, methods on the returned File can be used for I/O. If there is an error, it will be of type *PathError.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL