fs

package
v5.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DirPerms = 0755

Variables

View Source
var ErrNoDirEntryFound noDirEntryFoundError

Functions

func CopyDirectoryPreservingTimestamp

func CopyDirectoryPreservingTimestamp(source, dest string) error

CopyDirectoryPreservingTimestamp copies the source directory to the destination, preserving the modification and access times.

func CopyFile

func CopyFile(source, dest string) (err error)

CopyFile copies the source file to the destination, preserving the modification and access times.

func CopyPreservingTimestamp

func CopyPreservingTimestamp(source, dest string) error

CopyPreservingTimestamp copies the source to the dest, recursively, preserving the modification and access times.

func DirEntryModTime

func DirEntryModTime(de os.DirEntry) time.Time

DirEntryModTime returns the ModTime of the given DirEntry, treating errors as time 0.

func FindLatestCombinedOutput

func FindLatestCombinedOutput(dir, watchFile string) (string, error)

FindLatestCombinedOutput finds the entry in dir that contains the newest watchFile.

func FindLatestDirectoryEntry

func FindLatestDirectoryEntry(dir, suffix string) (string, error)

FindLatestDirectoryEntry finds the latest entry in dir that has the given suffix and returns its path.

func ModTime

func ModTime(path string) time.Time

ModTime returns the ModTime for the given path, treating errors as time 0.

func RemoveFromDirWhenOlderThan

func RemoveFromDirWhenOlderThan(dir string, before time.Time) error

RemoveFromDirWhenOlderThan removes all children of the given directory if their modification time is before the time specified.

func Touch

func Touch(path string, t time.Time) error

Touch updates the modtime and access time of the specified path to the specified time.

Types

This section is empty.

Jump to

Keyboard shortcuts

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