https://github.com/koding/file
File related utils for Go
https://github.com/koding/file
Last synced: 10 months ago
JSON representation
File related utils for Go
- Host: GitHub
- URL: https://github.com/koding/file
- Owner: koding
- License: mit
- Created: 2014-02-15T10:12:42.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-02-15T10:49:33.000Z (almost 12 years ago)
- Last Synced: 2025-01-20T10:11:28.005Z (11 months ago)
- Language: Go
- Size: 121 KB
- Stars: 3
- Watchers: 13
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# File [](http://godoc.org/github.com/koding/file)
*WIP, DO NOT USE IN PRODUCTION*
File includes several useful file related helper functions. Especially common
tasks like copying a file or directory, checking if a file exists, etc. are
not easy to write in Go.
For usage see examples below or click on the godoc badge.
## Install
```bash
go get github.com/koding/file
```
## Examples
```go
// copy recursively exampleDir to a new test directory
err := file.Copy("exampleDir", "testDir")
// copy a file into a folder
err := file.Copy("hello.txt", "./exampleDir")
// create a copy of a given file
err := file.Copy("hello.txt", "another.txt")
// check if a file exists
ok := file.Exists("hello.txt")
// Is the given path a file?
ok := file.IsFile("another.png")
```
## License
The MIT License (MIT) - see LICENSE.md for more details