file

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: MIT Imports: 6 Imported by: 9

Documentation

Overview

Package file defines functions to determine the file contents. For example, IsFile() returns whether the path is a file or not with a bool value.

Index

Constants

View Source
const (
	// Unknown : Don't use this bits
	Unknown os.FileMode = 1 << (9 - iota)
	// Readable : readable bits
	Readable
	// Writable : writable bits
	Writable
	// Executable : executable bits
	Executable
)
View Source
const (
	// FileModeCreatingDir is used for creating directory
	FileModeCreatingDir fs.FileMode = 0750
	// FileModeCreatingFile is used for creating directory
	FileModeCreatingFile fs.FileMode = 0600
)

Variables

This section is empty.

Functions

func Copy

func Copy(src string, dest string) error

Copy copy file to destination path

func Exists

func Exists(path string) bool

Exists reports whether the path exists.

func IsDir

func IsDir(path string) bool

IsDir reports whether the path exists and is a directory.

func IsExecutable

func IsExecutable(path string) bool

IsExecutable reports whether the path exists and is executable.

func IsFile

func IsFile(path string) bool

IsFile reports whether the path exists and is a file.

func IsHiddenFile

func IsHiddenFile(filePath string) bool

IsHiddenFile reports whether the path exists and is included hidden file.

func IsReadable

func IsReadable(path string) bool

IsReadable reports whether the path exists and is readable.

func IsSymlink(path string) bool

IsSymlink reports whether the path exists and is a symbolic link.

func IsWritable

func IsWritable(path string) bool

IsWritable reports whether the path exists and is writable.

func IsZero

func IsZero(path string) bool

IsZero reports whether the path exists and is zero size.

Types

This section is empty.

Jump to

Keyboard shortcuts

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