Handbook
Glossary
send-to-trash ( path -- )
Vocabulary
io
.
files
.
trash
Inputs
path
a file path
Outputs
None
Word description
Send a file path to the trash bin.
Definition
USING:
system
;
IN:
io.files.trash
HOOK:
send-to-trash
os
( path -- )
Methods
USING:
io.backend
io.files.trash
io.files.trash.macos.private
system
;
M:
macos
send-to-trash
normalize-path
<fs-ref>
f
kFSFileOperationDefaultOptions
FSMoveObjectToTrashSync
check-err
;
USING:
calendar
formatting
io
io.backend
io.directories
io.encodings.utf8
io.files
io.files.trash
io.files.trash.unix.private
io.pathnames
kernel
sequences
system
;
M:
unix
send-to-trash
normalize-path
dup
trash-path
[
"files"
append-path
[
make-user-directory
]
keep
to-directory
safe-file-name
]
[
"info"
append-path
[
make-user-directory
]
keep
to-directory
".trashinfo"
append
overd
utf8
[
"[Trash Info]"
print
"Path="
write
print
"DeletionDate="
write
now
"%Y-%m-%dT%H:%M:%S"
strftime
print
]
with-file-writer
]
bi
move-file
;