fileutil

package
v0.11.5-beta.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StaticMimeTypeMap = map[string]string{}/* 1260 elements not displayed */

Functions

func AddMimeTypeToFileInfo added in v0.11.1

func AddMimeTypeToFileInfo(path string, fileInfo *wshrpc.FileInfo)

func DetectMimeType

func DetectMimeType(path string, fileInfo fs.FileInfo, extended bool) string

on error just returns "" does not return "application/octet-stream" as this is considered a detection failure can pass an existing fileInfo to avoid re-statting the file falls back to text/plain for 0 byte files

func DetectMimeTypeWithDirEnt added in v0.11.1

func DetectMimeTypeWithDirEnt(path string, dirEnt fs.DirEntry) string

func FixPath

func FixPath(path string) (string, error)

func IsInitScriptPath

func IsInitScriptPath(input string) bool

IsInitScriptPath tries to determine if the input string is a path to a script rather than an inline script content.

func WinSymlinkDir

func WinSymlinkDir(path string, bits os.FileMode) bool

Types

type FsFileInfo added in v0.11.1

type FsFileInfo struct {
	NameInternal    string
	ModeInternal    os.FileMode
	SizeInternal    int64
	ModTimeInternal int64
	IsDirInternal   bool
}

func ToFsFileInfo added in v0.11.1

func ToFsFileInfo(fi *wshrpc.FileInfo) FsFileInfo

ToFsFileInfo converts wshrpc.FileInfo to FsFileInfo. It panics if fi is nil.

func (FsFileInfo) IsDir added in v0.11.1

func (f FsFileInfo) IsDir() bool

func (FsFileInfo) ModTime added in v0.11.1

func (f FsFileInfo) ModTime() time.Time

func (FsFileInfo) Mode added in v0.11.1

func (f FsFileInfo) Mode() os.FileMode

func (FsFileInfo) Name added in v0.11.1

func (f FsFileInfo) Name() string

func (FsFileInfo) Size added in v0.11.1

func (f FsFileInfo) Size() int64

func (FsFileInfo) Sys added in v0.11.1

func (f FsFileInfo) Sys() interface{}

Jump to

Keyboard shortcuts

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