An open API service indexing awesome lists of open source software.

https://github.com/kilianpaquier/filesystem

Easily work around files and directories in golang
https://github.com/kilianpaquier/filesystem

filesystem-library golang

Last synced: 11 months ago
JSON representation

Easily work around files and directories in golang

Awesome Lists containing this project

README

          

# filesystem

**Archive note**: Use [craft fs package](https://github.com/kilianpaquier/craft/tree/main/pkg/fs) which is cleaned up and better maintained.


GitHub Actions
GitHub Release
GitHub Issues
GitHub License
Coverage
Go Version
Go Report Card

---

- [How to use ?](#how-to-use-)
- [Features](#features)

## How to use ?

```sh
go get -u github.com/kilianpaquier/filesystem@latest
```

## Features

The filesystem package exposes some useful function around files, for instance a simple function as `func Exists(src) bool` to verify a file existence easily.

It also exposes `CopyFile(src, dst) error` and `CopyFileWithPerm(src, dst, perm) error` which copy a given src file to dst with either specific permissions or not.

It also exposes `CopyDir(srcdir, destdir)` to copy a full directory at another place. The destination directory will be created if it doesn't already.

The package also exposes some constants around permissions.