A go library for moving files to the trashbin
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.circleci
.travis.yml Remove build dependency trash for mac os Sep 9, 2018
LICENSE Add MPL 2.0 license Aug 29, 2018
README.md
appveyor.yml
wastebasket_darwin.go
wastebasket_linux.go
wastebasket_test.go
wastebasket_windows.go Fixed minor typo in documentation[skip ci] Aug 30, 2018

README.md

Wastebasket

OS master develop
linux CircleCI - Linux - master CircleCI - Linux - develop
darwin / linux Travis CI - Darwin and Linux - master Travis CI - Darwin and Linux - develop
windows AppVeyor - Windows - master AppVeyor - Windows- develop

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/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()
}