Re: rm -rf and the trashcan
Re: rm -rf and the trashcan
- Subject: Re: rm -rf and the trashcan
- From: Esteban Bodigami <email@hidden>
- Date: Mon, 20 Jul 2009 17:06:06 -0600
...i will just add the missing bits...
thanks for the code.
Jean-Daniel Dupas
<email@hidden>
"darwin only" does not really exists.
Le 21 juil. 09 à 00:47, Esteban Bodigami a écrit :
as far as i know, Finder.app is not open source... so, i am talking of Darwin-only here.
maybe the command stt? send_to_trash
2552/7/20 Greg Shenaut
<email@hidden>
On Jul 20, 2009, at 12:00 PM, Esteban Bodigami wrote:
unless the OS relies on all Unix commands and has to be translated to all possible languages (the "talking with the kernel" text interface).
2009/7/20 Jean-Daniel Dupas <email@hidden>
alias borrar 'mv ~/.Trash'
No need to rewrite an OS to get it.
Aliasing standard commands like "rm" has been part of UNIX for decades. If a certain user aliases things or defines functions in his or her own shell, shell scripts and other people's shells normally won't see them, so it will have no effect on the system as a whole.
But it should be mentioned that defining a shell function to imitate the Finder's trash functionality is not just « function rm { mv $* ~/.Trash ; } », because the Finder will modify filenames to avoid overwriting the older contents of Trash. You could definitely write a shell function to mimic what Finder does, but another approach would be to use osascript in your shell function to tell Finder to do it for you.
That said, why not name the function something different? The functionality is significantly different and so the two actions deserve different names. Use rm for the standard utility, perhaps, and del or even d for the trash version?
Greg Shenaut
Le 20 juil. 09 à 20:44, Esteban Bodigami a écrit :
[borrar, delete] maps to mv ~/.Trash
BR, new command... Unix + Mac Version 2.0 (Mac OS 11)
2009/7/20 Steve Allen <email@hidden>
On Jul 20, 11:07, Esteban Bodigami wrote:
>
>nah, a Unix-compatible version with a new user interface... that's all. what
>is the equivalent of X in Mac btw? Aqua must use some kind of renderer... i
>was thinking of OpenGL, Darwin and Webkit as a base for my project.
The equivalent to X on Mac is... X. The one and same, also a standard.
The "trashcan" is an artifact of the Apple gui, much as Gnome has a
trashcan, and I'm sure that there are other guis that have trashcans and
ones that don't. But it's not part of the Unix standard, and rm is.
--
Esteban Giuseppe Bodigami Vincenzi
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden