stat

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package stat provides structs for describing file into that can be used across file systems.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileInfo

type FileInfo struct {
	FileInfo os.FileInfo
}

FileInfo wraps os.FileInfo and adds some additional functions.

func NewFileInfo

func NewFileInfo(f os.FileInfo) *FileInfo

func (*FileInfo) IsCharacterDevice

func (f *FileInfo) IsCharacterDevice() bool

func (*FileInfo) IsDevice

func (f *FileInfo) IsDevice() bool

IsDevice returns true if the file is a device.

func (*FileInfo) IsDir

func (f *FileInfo) IsDir() bool

IsDir returns true if the file is a directory.

func (*FileInfo) IsNamedPipe

func (f *FileInfo) IsNamedPipe() bool

IsNamedPipe returns true if the file is a named pipe. Returns true is a device is available as a named pipe within the context of the current process. Only if stdin has data to be read, will it return true (including as a path /dev/stdin). Stdout will either return as a named pipe or device depending on the context.

func (*FileInfo) IsRegular

func (f *FileInfo) IsRegular() bool

IsRegular returns true if the file is a regular file.

func (*FileInfo) Mode

func (f *FileInfo) Mode() os.FileMode

Mode returns the file mode.

func (*FileInfo) Perm

func (f *FileInfo) Perm() os.FileMode

Perm returns the file mode permissions bits.

func (*FileInfo) Size

func (f *FileInfo) Size() int64

Size retuns the file size as int64.

type Info

type Info interface {
	IsRegular() bool
	IsDevice() bool
	IsCharacterDevice() bool
	IsNamedPipe() bool
	Mode() os.FileMode
	Perm() os.FileMode
	Size() int64
}

Info is a simple interface for returning file info.

Jump to

Keyboard shortcuts

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