Documentation
¶
Overview ¶
Package gofile provides support for file operations.
Index ¶
- func Copy(src, dest string) (int64, error)
- func Create(filename string) io.ReadWriteCloser
- func CreateSafe(filename string) io.ReadWriteCloser
- func Err(err error) error
- func InitialCapacity(capacity int64) int
- func IsDir(name string) bool
- func Mode(file string) os.FileMode
- func PWD() string
- func Stat(file string) os.FileInfo
- func StatCheck(filename string) (os.FileInfo, error)
- type PathError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(filename string) io.ReadWriteCloser
Create creates or truncates the named file and returns an opened file as io.ReadCloser.
If the file already exists, it is truncated. If the file does not exist, it is created with mode 0666 (before umask). If successful, methods on the returned File can be used for I/O; the associated file descriptor has mode O_RDWR. If there is an error, it will be of type *PathError.
If the file cannot be created, an error of type *PathError is returned.
Errors are logged if gofile.Err is active.
func CreateSafe ¶
func CreateSafe(filename string) io.ReadWriteCloser
CreateSafe creates the named file and returns an opened file as io.ReadCloser.
If successful, methods on the returned File can be used for I/O; the associated file descriptor has mode O_RDWR.
If the file already exists, nil is returned. Errors are logged if Err is active.
If the file already exists, of an error occurs, it returns nil and an error is sent to Err. If there is an error, it will be of type *PathError.
func InitialCapacity ¶
InitialCapacity returns the multiple of 'chunk' one more than needed to accomodate the given capacity.
func PWD ¶
func PWD() string
PWD returns a rooted path name corresponding to the current directory. If the current directory can be reached via multiple paths (due to symbolic links), Getwd may return any one of them.
Types ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
dir
command
|
|
|
redlog
command
|
|
|
Package json implements json serialization and deserialization.
|
Package json implements json serialization and deserialization. |
|
Package redlogger implements logging to an io.Writer (default stderr) with text wrapped in ANSI escape codes
|
Package redlogger implements logging to an io.Writer (default stderr) with text wrapped in ANSI escape codes |