sequential – github.com/moby/sys/sequential Index | Files

package sequential

import "github.com/moby/sys/sequential"

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

Functions

func Create

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

Create is a copy of os.Create, modified to use sequential file access.

It uses windows.FILE_FLAG_SEQUENTIAL_SCAN rather than windows.FILE_ATTRIBUTE_NORMAL as implemented in golang. Refer to the Win32 API documentation for details on sequential file access.

func CreateTemp

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

CreateTemp is a copy of os.CreateTemp, modified to use sequential file access.

It uses windows.FILE_FLAG_SEQUENTIAL_SCAN rather than windows.FILE_ATTRIBUTE_NORMAL as implemented in golang. Refer to the Win32 API documentation for details on sequential file access.

func Open

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

Open is a copy of os.Open, modified to use sequential file access.

It uses windows.FILE_FLAG_SEQUENTIAL_SCAN rather than windows.FILE_ATTRIBUTE_NORMAL as implemented in golang. Refer to the Win32 API documentation for details on sequential file access.

func OpenFile

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

OpenFile is a copy of os.OpenFile, modified to use sequential file access.

It uses windows.FILE_FLAG_SEQUENTIAL_SCAN rather than windows.FILE_ATTRIBUTE_NORMAL as implemented in golang. Refer to the Win32 API documentation for details on sequential file access.

Source Files

doc.go sequential_windows.go

Version
v0.6.0 (latest)
Published
Jul 16, 2024
Platform
windows/amd64
Imports
7 packages
Last checked
now

Tools for package owners.