atomicfile

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package atomicfile provides wrappers for atomically writing files in a manner compatible with long filenames.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaybePrefixLongFilenameOnWindows

func MaybePrefixLongFilenameOnWindows(fname string) string

MaybePrefixLongFilenameOnWindows prefixes the given filename with \\?\ on Windows if the filename is longer than 260 characters, which is required to be able to use some low-level Windows APIs. Because long file names have certain limitations: - we must replace forward slashes with backslashes. - dummy path element (\.\) must be removed.

Relative paths are always limited to a total of MAX_PATH characters: https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation

func Write

func Write(filename string, r io.Reader) error

Write is a wrapper around atomic.WriteFile that handles long file names on Windows.

Types

This section is empty.

Jump to

Keyboard shortcuts

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