fs

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DevMapper

type DevMapper interface {
	// Convert receives the fully qualified file path and replaces the DOS device name with a drive letter.
	Convert(filename string) string
}

DevMapper is the minimal interface for the device converters.

func NewDevMapper

func NewDevMapper() DevMapper

NewDevMapper creates a new instance of the DOS device replacer.

type FileAttr

type FileAttr uint32

FileAttr represents a type alias for the file attribute enumeration.

const (
	// FileDirectory indicates that the file is a directory.
	FileDirectory FileAttr = 0x10
	// FileArchive denotes a file or directory that is an archive file or directory. Applications typically use this attribute to mark files for backup or removal.
	FileArchive FileAttr = 0x20
	// FileCompressed represents a file or a directory that is compressed.
	FileCompressed FileAttr = 0x800
	// FileEncrypted represents a file or a directory that is encrypted
	FileEncrypted FileAttr = 0x4000
	// FileHidden designates a file or directory that is hidden, i.e. it is not included in an ordinary directory listing.
	FileHidden FileAttr = 0x2
	// FileReparsePoint represents a file or directory that has an associated reparse point, or a file that is a symbolic link.
	FileReparsePoint FileAttr = 0x400
	// FileSparse denotes a sparse file. Spares files can optimize disk usage as the system does not allocate disk space for the file regions with sparse data.
	FileSparse = 0x200
	// FileTemporary denotes files that are used for temporary storage.
	FileTemporary = 0x100
)

func (FileAttr) String

func (fa FileAttr) String() string

FileAttr returns human-readable file attribute name.

type FileDisposition

type FileDisposition uint8

FileDisposition is the alias for the file disposition modes

const (
	// Supersede dictates that if the file already exists, it is replaced with the given file. Otherwise the file with given name is created.
	Supersede FileDisposition = iota
	// Open opens the file if it already exists instead of creating a new file.
	Open
	// Create fails if the file already exists.
	Create
	// OpenIf opens the file if it already exists or creates a new file otherwise.
	OpenIf
	// Overwrite opens and overwrites the file if it already exists. Otherwise it fails.
	Overwrite
	// OverwriteIf opens and overwrites the file is it already exists. Otherwise it creates a new file.
	OverwriteIf
)

func (FileDisposition) String

func (fd FileDisposition) String() string

String returns the textual representation of the file disposition.

type FileShareMode

type FileShareMode uint8

FileShareMode designates a type alias for file share mode values

const (
	// FileShareRead allows threads to gain read access to the file
	FileShareRead FileShareMode = 1
	// FileShareWrite allows threads to gain write access to the file
	FileShareWrite FileShareMode = 1 << 1
	// FileShareDelete grants threads the possibility to delete files
	FileShareDelete FileShareMode = 1 << 2
)

func (FileShareMode) String

func (shareMode FileShareMode) String() string

String returns user-friendly representation of the file share mask.

type FileType

type FileType uint8

FileType is the the type alias for the file type

const (
	// Regular represents the file, volume or hard disk device
	Regular FileType = iota
	// Directory represents the directory
	Directory
	// Pipe represent the pipe
	Pipe
	// Console denotes the standard output stream
	Console
	// Mailslot denotes a mail slot file
	Mailslot
	// Other is the file type different from listed above
	Other
	// Unknown is the unknown file type
	Unknown
)

func GetFileType

func GetFileType(filename string, opts uint32) FileType

GetFileType returns the underlying file type. The opts parameter corresponds to the NtCreateFile CreateOptions argument that specifies the options to be applied when creating or opening the file.

func (FileType) String

func (typ FileType) String() string

String returns the textual representation of the file type.

Jump to

Keyboard shortcuts

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