filesystem

package
v0.0.0-...-a273a24 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT-0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func CheckFileOwnerRights

func CheckFileOwnerRights(filePath, requiredOwner string) error

CheckFileOwnerRights check that the given owner is the same owner of the given filepath

func CheckFileRights

func CheckFileRights(filePath string) error

CheckFileRights check that the given file path has been protected by the owner. If the owner is changed, they need at least the sudo permission to override the owner.

func FileHasPermission

func FileHasPermission(filePath string, permission FilePermission) (bool, error)

func GetFileGroupName

func GetFileGroupName(filePath string) (string, error)

func GetFileOwnerUserName

func GetFileOwnerUserName(filePath string) (string, error)

func GetFileStatPermission

func GetFileStatPermission(filePath string) (uint32, error)

Types

type FilePermission

type FilePermission string
const (
	OwnerWrite  FilePermission = "OwnerWrite"
	GroupWrite  FilePermission = "GroupWrite"
	AnyoneWrite FilePermission = "AnyoneWrite"
	OwnerRead   FilePermission = "OwnerRead"
	AnyoneRead  FilePermission = "AnyoneRead"
)

Jump to

Keyboard shortcuts

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