Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dastoori/higgs
A tiny cross-platform Go library to hide/unhide files and directories
https://github.com/dastoori/higgs
directory file file-handling fs go golang hidden hidden-files hide hide-files hide-folder higgs macos ubuntu unix windows
Last synced: about 2 months ago
JSON representation
A tiny cross-platform Go library to hide/unhide files and directories
- Host: GitHub
- URL: https://github.com/dastoori/higgs
- Owner: dastoori
- License: mit
- Created: 2020-12-13T18:33:10.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-01-29T13:29:27.000Z (almost 3 years ago)
- Last Synced: 2024-07-31T20:51:28.829Z (5 months ago)
- Topics: directory, file, file-handling, fs, go, golang, hidden, hidden-files, hide, hide-files, hide-folder, higgs, macos, ubuntu, unix, windows
- Language: Go
- Homepage:
- Size: 30.3 KB
- Stars: 22
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - higgs - A tiny cross-platform Go library to hide/unhide files and directories. (File Handling / Search and Analytic Databases)
- awesome-go-extra - higgs - platform Go library to hide/unhide files and directories|11|3|0|2020-12-13T18:33:10Z|2022-01-29T13:29:27Z| (File Handling / Advanced Console UIs)
README
# higgs
A tiny cross-platform Go library to hide or unhide files and directories.
**Supported OSs:** All unix based OSs (Tested on Ubuntu, MacOS), Windows
[![unix](https://github.com/dastoori/higgs/actions/workflows/unix.yml/badge.svg)](https://github.com/dastoori/higgs/actions/workflows/unix.yml)
[![windows](https://github.com/dastoori/higgs/actions/workflows/windows.yml/badge.svg)](https://github.com/dastoori/higgs/actions/workflows/windows.yml)
[![codecov](https://codecov.io/gh/dastoori/higgs/branch/master/graph/badge.svg?token=T1AJXSWI3F)](https://codecov.io/gh/dastoori/higgs)
[![GitHub release](https://img.shields.io/github/v/release/dastoori/higgs?sort=semver)](https://github.com/dastoori/higgs/releases)
[![Go Reference](https://pkg.go.dev/badge/github.com/dastoori/higgs.svg)](https://pkg.go.dev/github.com/dastoori/higgs)
![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/dastoori/higgs)
[![Go Report Card](https://goreportcard.com/badge/github.com/dastoori/higgs)](https://goreportcard.com/report/github.com/dastoori/higgs)
[![GitHub](https://img.shields.io/github/license/dastoori/higgs)](https://github.com/dastoori/higgs/blob/master/LICENSE)
[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)## Installation
```sh
$ go get github.com/dastoori/higgs
```## Usage
```go
package mainimport (
"fmt"
"github.com/dastoori/higgs"
)func main() {
path := "foo.txt"// Hiding a file
newPath, err := higgs.Hide(path)
// NOTE: On Unix after hiding the file the file name
// will be changed to `.foo.txt` and `newPath` contains
// the new file nameif err != nil {
fmt.Println(err)
}// Unhiding a file
newPath, err = higgs.Unhide(newPath)
if err != nil {
fmt.Println(err)
}// Setting unix overwrite option (disable by default)
fh := NewFileHide(".bar.txt", UnixOverwriteOption(true))// NOTE: On Unix if a `bar.txt` file exists, it will be
// overwritten after unhiding `.bar.txt`
err := fh.Unhide()
if err != nil {
fmt.Println(err)
}// NOTE: `fh.Path` contains the new file name
}
```## License
MIT