Skip to content

Instantly share code, notes, and snippets.

@vy-let
Created August 27, 2015 04:13
Show Gist options
  • Save vy-let/70ebe0b7b70881c3dc73 to your computer and use it in GitHub Desktop.
Save vy-let/70ebe0b7b70881c3dc73 to your computer and use it in GitHub Desktop.
//
// trash.sandpiper
// For moving something to the trash from the command line
// (instead of rm'ing it)
// in the Glorious Sandpiper Language.
//
// Created by Violet Baddley on 2015-8-25.
// Copyright © 2015 Violet Baddley. All rights reserved.
// Provided under the 2-Clause BSD License.
//
trash-files => Process: arguments: map [ URL: file-url-with-path %0 ].
trash-files: each [ trash-file ->
FileManager: trash-item-at-url trash-file ! <= new-loc</>error.
^^ error ? [
Stdout puts “Couldn’t trash (trash-file relative-path): (error localized-description)”.
^nil.
].
] !
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment