osutil

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ModeUserRW = 0600 // rw-------
View Source
const ModeUserRWX = 0700 // rwx------
View Source
const ModeUserRWXGroupRX = 0750 // rwxr-x---

Variables

View Source
var ErrUnsupportedFileType = errors.New("unsupported file type")

ErrUnsupportedFileType is returned when attempting to copy a file type that's not supported.

Functions

func CopyDir

func CopyDir(srcDir, dstDir string) error

CopyDir recursively copies a directory from 'srcDir' to 'dstDir', preserving soft links. All regular files will be hard copied. Note that file attributes are not preserved, so this should only be used when the folder contents are required in the original structure. This implementation is based on [1].

[1] https://github.com/moby/moby/blob/master/daemon/graphdriver/copy/copy.go

func EnsureDir

func EnsureDir(path string, perm fs.FileMode) error

EnsureDir verifies that the specified path exists, is a directory, and has the specified permission bits set.

Types

This section is empty.

Jump to

Keyboard shortcuts

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