fil

package module
v0.0.0-...-6109b2e Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2015 License: MIT Imports: 7 Imported by: 6

README

fil, a go library

API MIT License Gratipay

The MIT License (MIT)

Copyright (c) 2015 Guten Ye

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Documentation

Index

Constants

View Source
const (
	Separator     = os.PathSeparator
	ListSeparator = os.PathListSeparator
)

Variables

This section is empty.

Functions

func Abs

func Abs(path string) (string, error)

func Base

func Base(path string) string

func Chdir

func Chdir(dir string) error

func Chmod

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

func ChmodR

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

func Chown

func Chown(name string, uid, gid int) error

func ChownR

func ChownR(path string, uid, gid int) error

func Chtimes

func Chtimes(name string, atime time.Time, mtime time.Time) error

func Clean

func Clean(path string) string

func Cp

func Cp(src, dest string) error

func CpDirOnly

func CpDirOnly(src, dest string) error

func CpR

func CpR(source, dest string) error

func CpSymlinkContent

func CpSymlinkContent(src, dest string) error

func CpWithOptions

func CpWithOptions(source, dest string, args Options) (err error)

func Dir

func Dir(path string) string
func EvalSymlinks(path string) (string, error)

func Ext

func Ext(path string) string

func FromSlash

func FromSlash(path string) string

func Getwd

func Getwd() (dir string, err error)

func Glob

func Glob(pattern string) (matches []string, err error)

func HasPrefix

func HasPrefix(p, prefix string) bool

func IsAbs

func IsAbs(path string) bool

func IsDir

func IsDir(path string) (bool, error)

func IsExists

func IsExists(path string) (bool, error)

Exists checks whether the given file exists or not.

func IsFile

func IsFile(path string) (bool, error)

func IsNotExist

func IsNotExist(path string) (bool, error)

func IsRegular

func IsRegular(path string) (bool, error)

func Join

func Join(elem ...string) string

func Lchown

func Lchown(name string, uid, gid int) error
func Link(oldname, newname string) error

func LookPath

func LookPath(file string) (string, error)

func Lstat

func Lstat(name string) (os.FileInfo, error)

func Match

func Match(pattern, name string) (matched bool, err error)

func Mkdir

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

func MkdirAll

func MkdirAll(path string, perm os.FileMode) error

func MkdirP

func MkdirP(path string, perm os.FileMode) error

func Mv

func Mv(oldname, newname string) error

func NopCloser

func NopCloser(r io.Reader) io.ReadCloser

func ReadAll

func ReadAll(r io.Reader) ([]byte, error)

func ReadDir

func ReadDir(dirname string) ([]os.FileInfo, error)

func ReadFile

func ReadFile(filename string) ([]byte, error)
func Readlink(name string) (string, error)

func Rel

func Rel(basepath, targpath string) (string, error)

func Remove

func Remove(path string) error

func RemoveAll

func RemoveAll(path string) error

func Rename

func Rename(oldname, newname string) error

func Rm

func Rm(name string) error

func RmRF

func RmRF(path string) error

func SameFile

func SameFile(fi1, fi2 os.FileInfo) bool

func Split

func Split(path string) (dir, file string)

func SplitList

func SplitList(path string) []string

func Stat

func Stat(name string) (os.FileInfo, error)
func Symlink(oldname, newname string) error

func TempDir

func TempDir(dir, prefix string) (name string, err error)

func TempFile

func TempFile(dir, prefix string) (f *os.File, err error)

func ToSlash

func ToSlash(path string) string

func Truncate

func Truncate(name string, size int64) error

func Type

func Type(path string) (string, error)

func TypeFileInfo

func TypeFileInfo(fi os.FileInfo) string

func VolumeName

func VolumeName(path string) (v string)

func Walk

func Walk(root string, walkFn filepath.WalkFunc) error

func Which

func Which(file string) (string, error)

func WriteFile

func WriteFile(filename string, data []byte, perm os.FileMode) error

Types

type Options

type Options struct {
	Recursive       bool
	PreserveLinks   bool
	PreserveModTime bool
}

Jump to

Keyboard shortcuts

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