atomicfile

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 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.

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