fileutil

package
v0.0.0-...-130f5e9 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2018 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Overview

Copyright (c) 2015-2018 All rights reserved. 本软件源代码版权归 my.oschina.net/tantexian 所有,允许复制与学习借鉴. Author: tantexian, <tantexian@qq.com> Since: 2017/8/7

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Basename

func Basename(fp string) string

get filepath base name

func EnsureDir

func EnsureDir(fp string) error

EnsureDir dir if not exist 如果path为"./tmp/test/test.txt"则只会创建./tmp/test/目录 Author: tantexian, <tantexian@qq.com> Since: 2017/8/8

func FileDir

func FileDir(fp string) string

get filepath dir name

func FileSize

func FileSize(file *os.File) (int64, error)

func InsureDir

func InsureDir(fp string) error

func IsExist

func IsExist(fp string) bool

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

func ListFilesOrDir

func ListFilesOrDir(path string, listType string) ([]string, error)

ListFilesOrDir 返回当前目录下所有的文件或者目录 Params: path 路径 Return: listType 从ALL|DIR|FILE选取,分别代表返回所有,目录,文件 Author: tantexian, <tantexian@qq.com> Since: 2017/8/8

func Offset2FileName

func Offset2FileName(offset int64) string

Offset2FileName 格式化位20个字符长度的string Author: tantexian, <tantexian@qq.com> Since: 2017/8/9

Types

This section is empty.

Jump to

Keyboard shortcuts

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