osutil

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: MIT Imports: 4 Imported by: 7

Documentation

Overview

Package osutil implements some OS utility functions.

Index

Constants

View Source
const (
	DefaultFileMode os.FileMode = 0644
	DefaultDirMode  os.FileMode = 0755
)

Variables

This section is empty.

Functions

func CopyFile added in v1.2.0

func CopyFile(srcPath, destPath string) (int64, error)

CopyFile reads data from source file and writes to target file. If the target file already exists, it is overwritten.

func MoveFile added in v1.2.1

func MoveFile(srcPath, destPath string) (err error)

MoveFile moves the specified file from srcPath to destPath. If os.Rename() fails, try to osutil.CopyFile() and then os.Remove().

func WaitFor added in v1.3.4

func WaitFor(signals ...os.Signal)

WaitFor blocks until current process receives any of signals.

func WaitForInterrupt

func WaitForInterrupt()

WaitForInterrupt blocks until current process receives SIGINT.

func WaitForStop added in v1.3.4

func WaitForStop()

WaitForStop blocks until current process receives SIGINT or SIGTERM.

Types

This section is empty.

Jump to

Keyboard shortcuts

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