Created
August 27, 2015 04:13
-
-
Save vy-let/70ebe0b7b70881c3dc73 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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