-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
44 lines (36 loc) · 1.12 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
= Overview
osx-trash is a command line program called trash[link:files/bin/trash.html]
to manipulate the trash on Mac OS X. It uses AppleScript via Scripting Bridge
on top of RubyCocoa to manipulate the trash, just like the Finder does. Here's
a simple example:
% touch foo bar baz
% trash -l
% trash foo ba*
% trash -l
/Users/dave/.Trash/foo
/Users/dave/.Trash/bar
/Users/dave/.Trash/baz
% trash -e
% trash -l
Using Finder's AppleScript has a number of benefits compared to shell scripts
that just move files to ~/.Trash. First, it creates unique names when there
are collisions:
% touch foo
% trash foo
% touch foo
% trash foo
% trash -l
/Users/dave/.Trash/foo
/Users/dave/.Trash/foo 20-38-20
It also handles trashes on different volumes properly:
% touch foo
% trash foo
% touch /Volumes/DiskImage/bar
% trash /Volumes/DiskImage/bar
% trash -l
/Users/dave/.Trash/foo
/Volumes/DiskImage/.Trashes/501/bar
= Links
* Project page: http://www.dribin.org/dave/osx-trash/
* RubyForge project: http://rubyforge.org/projects/osx-trash/
* Online documentation: http://osx-trash.rubyforge.org/api/