extos

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2021 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Overview

Package extos base tool

Package extos base tool

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Executable

func Executable() (dir, file string, err error)

Executable 和os.Executable() 一致,但是获取执行程序的所在路径和文件名

func FileCopy

func FileCopy(src, dest string) error

FileCopy copies file from source to target path.

func FileModTime

func FileModTime(file string) (int64, error)

FileModTime returns file modified time and possible error.

func FileMode

func FileMode(name string) (os.FileMode, error)

FileMode returns file mode and possible error.

func FileSize

func FileSize(file string) (int64, error)

FileSize returns file size in bytes and possible error.

func Filepaths

func Filepaths(root string) ([]string, error)

Filepaths returns all root dir (contain sub dir) file full path

func HasPermission

func HasPermission(name string) bool

HasPermission returns a boolean indicating whether that permission is allowed.

func IsDir

func IsDir(filePath string) bool

IsDir returns true if given path is a dir, or returns false when it's a file or does not exist.

func IsExist

func IsExist(paths string) bool

IsExist checks whether a file or directory exists. It returns false when the file or directory does not exist.

func IsFile

func IsFile(filePath string) bool

IsFile returns true if given path is a file, or returns false when it's a directory or does not exist.

func IsLinux

func IsLinux() bool

IsLinux 当前操作系统是否Linux.

func IsMac

func IsMac() bool

IsMac 当前操作系统是否Mac OS/X.

func IsMachineLittleEndian

func IsMachineLittleEndian() bool

IsMachineLittleEndian 判断系统大小端

func IsWindows

func IsWindows() bool

IsWindows 当前操作系统是否Windows.

func WriteFile

func WriteFile(filename string, data []byte) error

WriteFile writes data to a file named by filename. If the file does not exist, WriteFile creates it and its upper level paths.

Types

This section is empty.

Jump to

Keyboard shortcuts

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