OS | master | develop |
---|---|---|
linux | ||
darwin / linux | ||
windows |
Wastebasket is a go library allowing you to move files into your trashbin.
The only dependency is PowerShell.
Your either need to have gio
, gvfs-trash
or trash-cli
installed.
brew install trash
Run
go get github.com/Bios-Marcel/wastebasket
Example 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()
}