From: Werner LEMBERG <wl@gnu.org>
To: lennart.borgman@gmail.com
Cc: emacs-devel@gnu.org
Subject: Re: Why @#! is not Emacs using the Recycle bin on w32?
Date: Sat, 30 Aug 2008 20:37:55 +0200 (CEST) [thread overview]
Message-ID: <20080830.203755.13026242.wl@gnu.org> (raw)
In-Reply-To: <48B7F96C.5030908@gmail.com>
> > I use the `libtrash' library very successfully to prevent
> > accidental data loss (since I mainly work on the console which
> > never uses the trash folder of the GUI).
>
> Sounds interesting. At what level does it interface?
At the lowest one. Here some snippets of the README:
libtrash is a shared library which, when preloaded, will intercept
calls to a series of GNU libc functions and make sure that, if an
attempt to destroy certain files is made, these won't be permanently
destroyed but rather moved to a "trash can". It also allows the
user to mark certain directories as "unremovable", which means that
calls to functions which would result in the loss of files under
these directories will always fail, leaving those files untouched in
their original locations.
(This last feature is meant as a higher-level substitute for ext2fs'
"immutable" flag for use by those of us who rely on other file
systems. An important difference is that libtrash allows
non-privileged users to use this with their personal files.)
The GNU libc functions which can be overriden/"wrapped" are
- unlink() / unlinkat();
- rename() / renameat();
- fopen() / fopen64();
- freopen() / freopen64();
- open() / openat() / open64() / openat64().
You can individually enable / disable each of these "protections";
by default, only calls to the first two functions are intercepted.
[...]
libtrash recreates the directory structure of your home directory
under the trash can, which means that, should you need to recover
the mistakenly deleted file /home/user/programming/test.c, it will
be stored in /home/user/Trash/programming/test.c. If you have
instructed libtrash to also store copies of files which you delete
in directories outside of your home dir (see libtrash.conf for
details), they will be available under Trash/SYSTEM_ROOT. E.g.:
after deletion by the user joe, /common-dir/doc.txt will be
available at /home/joe/Trash/SYSTEM_ROOT/common-dir/doc.txt.
I have a cron job which simply deletes files in the `Trash' directory
older than 24 hours (using a script which comes with the libtrash
library).
Werner
next prev parent reply other threads:[~2008-08-30 18:37 UTC|newest]
Thread overview: 119+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-28 22:37 Why @#! is not Emacs using the Recycle bin on w32? Lennart Borgman (gmail)
2008-08-28 23:41 ` Michael Ekstrand
2008-08-29 0:16 ` Lennart Borgman (gmail)
2008-08-28 23:42 ` David De La Harpe Golden
2008-08-28 23:48 ` Lennart Borgman (gmail)
2008-08-28 23:54 ` Jason Rumney
2008-08-29 0:06 ` Lennart Borgman (gmail)
2008-08-29 5:39 ` Jason Rumney
2008-08-29 6:51 ` Lennart Borgman (gmail)
2008-08-29 7:52 ` Eli Zaretskii
2008-08-29 7:58 ` Lennart Borgman (gmail)
2008-08-29 8:06 ` Eli Zaretskii
2008-08-29 8:17 ` Lennart Borgman (gmail)
2008-08-29 9:24 ` Eli Zaretskii
2008-08-29 9:43 ` David House
2008-08-29 10:16 ` Eli Zaretskii
2008-08-29 13:26 ` Lennart Borgman (gmail)
2008-08-29 14:36 ` Eli Zaretskii
2008-08-29 15:06 ` Drew Adams
2008-08-29 15:11 ` Juanma Barranquero
2008-08-29 16:28 ` Drew Adams
2008-08-29 15:39 ` Alan Mackenzie
2008-08-29 16:32 ` Drew Adams
2008-08-29 16:43 ` David House
2008-08-29 22:12 ` René Kyllingstad
2008-08-30 0:29 ` David House
2008-08-30 0:33 ` Lennart Borgman (gmail)
2008-08-30 1:58 ` David House
2008-08-31 2:32 ` Sean Sieger
2008-08-31 2:34 ` Lennart Borgman (gmail)
2008-08-31 3:28 ` Sean Sieger
2008-08-29 19:58 ` Taylor Venable
2008-08-29 20:08 ` Lennart Borgman (gmail)
2008-08-29 20:46 ` Taylor Venable
2008-08-29 21:00 ` Lennart Borgman (gmail)
2008-08-29 21:59 ` Phil Jackson
2008-08-29 22:12 ` Lennart Borgman (gmail)
2008-08-29 23:43 ` Miles Bader
2008-08-30 9:49 ` Phil Jackson
2008-08-30 10:18 ` Alan Mackenzie
2008-08-30 10:43 ` Phil Jackson
2008-08-30 20:41 ` Lennart Borgman (gmail)
2008-08-30 14:03 ` Taylor Venable
2008-08-30 14:11 ` Lennart Borgman (gmail)
2008-08-30 22:32 ` Manoj Srivastava
2008-08-30 22:40 ` Lennart Borgman (gmail)
2008-08-31 3:35 ` Manoj Srivastava
2008-08-31 3:49 ` Lennart Borgman (gmail)
2008-08-30 23:04 ` David De La Harpe Golden
2008-08-31 3:37 ` Manoj Srivastava
2008-08-31 6:55 ` David De La Harpe Golden
2008-08-31 6:59 ` Alfred M. Szmidt
2008-08-31 9:31 ` David De La Harpe Golden
2008-08-31 13:51 ` Alfred M. Szmidt
2008-08-31 15:04 ` Lennart Borgman (gmail)
2008-08-31 16:38 ` Alfred M. Szmidt
2008-08-31 17:43 ` David De La Harpe Golden
2008-08-31 20:25 ` Lennart Borgman (gmail)
2008-08-31 10:46 ` David De La Harpe Golden
2008-08-29 20:12 ` Drew Adams
2008-08-29 23:43 ` David De La Harpe Golden
2008-08-30 0:21 ` Lennart Borgman (gmail)
2008-08-30 2:16 ` David De La Harpe Golden
2008-08-30 5:10 ` tomas
2008-08-30 21:26 ` David De La Harpe Golden
2008-08-31 4:53 ` tomas
2008-08-31 12:25 ` Lennart Borgman (gmail)
2008-08-31 16:51 ` tomas
2008-08-31 20:22 ` Lennart Borgman (gmail)
2008-09-01 4:33 ` tomas
2008-08-29 10:41 ` Jason Rumney
2008-08-29 11:35 ` martin rudalics
2008-08-29 12:16 ` David House
2008-08-29 13:22 ` Lennart Borgman (gmail)
2008-08-29 13:45 ` Lennart Borgman (gmail)
2008-08-29 14:00 ` Jason Rumney
2008-08-29 16:16 ` Francis Litterio
2008-08-29 9:19 ` David De La Harpe Golden
2008-08-29 8:16 ` David House
2008-08-29 8:18 ` Lennart Borgman (gmail)
2008-08-29 8:31 ` David House
2008-08-29 8:39 ` Lennart Borgman (gmail)
2008-08-29 10:01 ` Werner LEMBERG
2008-08-29 13:28 ` Lennart Borgman (gmail)
2008-08-30 18:37 ` Werner LEMBERG [this message]
2008-08-31 12:31 ` Lennart Borgman (gmail)
2008-08-31 19:26 ` Richard M. Stallman
2008-08-31 21:49 ` Werner LEMBERG
2008-08-29 10:57 ` Phil Jackson
2008-08-29 14:35 ` Eli Zaretskii
2008-08-29 18:37 ` Johannes Weiner
2008-08-29 19:59 ` Lennart Borgman (gmail)
2008-08-30 9:11 ` Johannes Weiner
2008-08-30 12:42 ` Lennart Borgman (gmail)
2008-08-30 13:26 ` Johannes Weiner
2008-08-30 13:58 ` Lennart Borgman (gmail)
2008-08-30 15:06 ` Johannes Weiner
2008-08-30 17:23 ` René Kyllingstad
2008-08-30 20:40 ` Lennart Borgman (gmail)
2008-08-29 22:37 ` Thomas Lord
2008-08-30 3:11 ` Stephen J. Turnbull
2008-08-30 9:40 ` Alan Mackenzie
2008-08-30 10:11 ` Eli Zaretskii
2008-08-30 15:03 ` Jason Rumney
2008-08-30 20:22 ` Lennart Borgman (gmail)
2008-08-30 9:36 ` Johannes Weiner
2008-08-31 1:30 ` Richard M. Stallman
2008-08-31 6:22 ` Johannes Weiner
2008-08-29 20:24 ` Gilaras Drakeson
2008-08-29 20:56 ` Drew Adams
2008-08-29 21:05 ` Lennart Borgman (gmail)
2008-08-29 21:11 ` Drew Adams
2008-08-29 21:13 ` Lennart Borgman (gmail)
2008-08-29 21:20 ` Drew Adams
2008-08-29 21:54 ` Lennart Borgman (gmail)
2008-08-29 22:20 ` Drew Adams
2008-08-29 22:25 ` Lennart Borgman (gmail)
2008-08-29 22:17 ` René Kyllingstad
2008-08-30 3:14 ` Stephen J. Turnbull
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080830.203755.13026242.wl@gnu.org \
--to=wl@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=lennart.borgman@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.