fsutil

package
v0.0.0-...-b5d9cbe Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package fsutil implements common file operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDir

func CopyDir(srcDir, dstDir string) error

CopyDir copies a directory from srcDir to dstDir. Target dir must not exist. The mode is preserved. The owner is also preserved if the EUID is 0.

func CopyFile

func CopyFile(src, dst string) error

CopyFile copies the regular file at path src to dst. dst is atomically replaced if it already exists and inherits src's mode. Ownership will also be preserved if the EUID is 0.

func MoveFile

func MoveFile(src, dst string) error

MoveFile moves the file at src to dst. The source and destination paths may be on different filesystems. The mode will be preserved, and ownership will also be preserved if possible (i.e. if called with an EUID of 0 or if moving the file within a filesystem).

Types

This section is empty.

Jump to

Keyboard shortcuts

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