fileex

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	OSRead       = 04
	OSWrite      = 02
	OSExec       = 01
	OSUserShift  = 6
	OSGroupShift = 3
	OSOtherShift = 0

	OSUserR   = OSRead << OSUserShift
	OSUserW   = OSWrite << OSUserShift
	OSUserX   = OSExec << OSUserShift
	OSUserRW  = OSUserR | OSUserW
	OSUserRWX = OSUserRW | OSUserX

	OSGroupR   = OSRead << OSGroupShift
	OSGroupW   = OSWrite << OSGroupShift
	OSGroupX   = OSExec << OSGroupShift
	OSGroupRW  = OSGroupR | OSGroupW
	OSGroupRWX = OSGroupRW | OSGroupX

	OSOtherR   = OSRead << OSOtherShift
	OSOtherW   = OSWrite << OSOtherShift
	OSOtherX   = OSExec << OSOtherShift
	OSOtherRW  = OSOtherR | OSOtherW
	OSOtherRWX = OSOtherRW | OSOtherX

	OSAllR   = OSUserR | OSGroupR | OSOtherR
	OSAllW   = OSUserW | OSGroupW | OSOtherW
	OSAllX   = OSUserX | OSGroupX | OSOtherX
	OSAllRW  = OSAllR | OSAllW
	OSAllRWX = OSAllRW | OSGroupX
)

Variables

This section is empty.

Functions

func FileSize

func FileSize(filePath string) (*int64, error)

FileSize returns the file size of the specified path file.

func ReadAllFile

func ReadAllFile(fqfn string) ([]byte, error)

ReadAllFile - Read file into byte array.

func WrapError

func WrapError(message string, err error) error

func WriteAllFile

func WriteAllFile(fqfn string, buffer []byte, perm fs.FileMode) error

WriteAllFile - Write byte array into file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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