Wastebasket
| OS | master | develop |
|---|---|---|
| linux | ||
| darwin / linux | ||
| windows |
Wastebasket is a go library allowing you to move files into your trashbin.
Dependencies
Windows
The only dependency is PowerShell.
Linux
Your either need to have gio, gvfs-trash or trash-cli installed.
Mac OS
The only dependency is the MacOS application Finder which is installed by default.
How do i use it
Run
go get github.com/Bios-Marcel/wastebasketExample usage in Go:
package main
import (
"fmt"
"io/ioutil"
"os"
"github.com/Bios-Marcel/wastebasket"
)
func main() {
ioutil.WriteFile("test.txt", []byte("Test"), os.ModePerm)
fmt.Println(wastebasket.Trash("test.txt"))
wastebasket.Empty()
}