From: Ian Campbell <ijc@hellion.org.uk>
To: Giuseppe Bilotta <bilotta78@hotpop.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 'Undeleting' an open file
Date: Fri, 07 Oct 2005 15:30:00 +0100 [thread overview]
Message-ID: <1128695400.28620.42.camel@icampbell-debian> (raw)
In-Reply-To: <8qo997np4h6n.1ihs13ptrx2y2.dlg@40tude.net>
On Fri, 2005-10-07 at 16:14 +0200, Giuseppe Bilotta wrote:
> On Wed, 5 Oct 2005 23:05:34 +0200 (CEST), Bodo Eggert wrote:
>
> > Files are deleted if the last reference is gone. If you play a music file
> > and unlink it while it's playing, it won't be deleted untill the player
> > closes the file, since an open filehandle is a reference.
>
> BTW, I've always wondered: is there a way to un-unlink such a file?
Access via /proc/PID/fd/* seems to work:
$ echo "Hello World" > testing
$ exec 10>>testing
$ rm testing
$ ls -l /proc/self/fd/
total 5
lrwx------ 1 icampbell icampbell 64 Oct 7 15:28 0 -> /dev/pts/9
lrwx------ 1 icampbell icampbell 64 Oct 7 15:28 1 -> /dev/pts/9
l-wx------ 1 icampbell icampbell 64 Oct 7 15:28 10
-> /home/icampbell/testing (deleted)
lrwx------ 1 icampbell icampbell 64 Oct 7 15:28 2 -> /dev/pts/9
lr-x------ 1 icampbell icampbell 64 Oct 7 15:28 3 -> /proc/31390/fd/
$ cat /proc/self/fd/10
Hello World
$
Ian.
--
Ian Campbell
Current Noise: Rotting Christ - In Domine Sathana
I may not be totally perfect, but parts of me are excellent.
-- Ashleigh Brilliant
next prev parent reply other threads:[~2005-10-07 14:30 UTC|newest]
Thread overview: 77+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4TiWy-4HQ-3@gated-at.bofh.it>
2005-10-02 22:43 ` what's next for the linux kernel? Robert Hancock
2005-10-02 23:32 ` Gene Heskett
2005-10-02 23:41 ` Vadim Lobanov
2005-10-02 23:48 ` Rik van Riel
2005-10-03 3:50 ` Gene Heskett
2005-10-03 9:39 ` Jesper Juhl
[not found] ` <4U0XH-3Gp-39@gated-at.bofh.it>
2005-10-04 22:04 ` Bodo Eggert
2005-10-05 10:36 ` Luke Kenneth Casson Leighton
2005-10-05 23:12 ` Nix
2005-10-05 23:28 ` Luke Kenneth Casson Leighton
2005-10-05 23:49 ` Nix
2005-10-05 14:34 ` Nix
2005-10-05 14:41 ` Marc Perkel
2005-10-05 14:44 ` Lennart Sorensen
2005-10-05 14:48 ` Marc Perkel
2005-10-05 14:56 ` Lennart Sorensen
2005-10-05 15:08 ` Marc Perkel
2005-10-05 15:26 ` Lennart Sorensen
2005-10-05 19:16 ` Nix
2005-10-05 19:30 ` Marc Perkel
2005-10-05 20:26 ` Nix
2005-10-08 16:49 ` Denis Vlasenko
2005-10-05 19:40 ` Al Viro
2005-10-05 19:49 ` Marc Perkel
2005-10-05 19:55 ` Lennart Sorensen
2005-10-05 20:25 ` linux-os (Dick Johnson)
2005-10-05 20:31 ` Nix
2005-10-05 14:59 ` Nigel Rantor
2005-10-05 16:16 ` Bodo Eggert
2005-10-05 19:37 ` Florin Malita
2005-10-05 19:44 ` Marc Perkel
2005-10-05 19:52 ` Lennart Sorensen
2005-10-05 20:05 ` Marc Perkel
2005-10-05 20:23 ` Lennart Sorensen
2005-10-06 2:56 ` Horst von Brand
2005-10-06 3:50 ` Marc Perkel
2005-10-06 4:12 ` Please STOP ! [was: what's next for the linux kernel?] Willy Tarreau
2005-10-06 3:19 ` [VERY-OT SCOX Crap] " jmerkey
2005-10-05 20:21 ` what's next for the linux kernel? Valdis.Kletnieks
2005-10-05 20:58 ` Dave Neuer
2005-10-05 21:05 ` Bodo Eggert
2005-10-07 14:14 ` 'Undeleting' an open file Giuseppe Bilotta
2005-10-07 14:25 ` Bernd Petrovitsch
2005-10-07 14:25 ` Jose Celestino
2005-10-07 14:30 ` Ian Campbell [this message]
2005-10-07 14:43 ` Bernd Petrovitsch
2005-10-07 15:04 ` Andreas Schwab
2005-10-07 15:14 ` Alex Riesen
2005-10-07 15:51 ` Bernd Petrovitsch
2005-10-07 14:30 ` Miquel van Smoorenburg
2005-10-07 17:25 ` Giuseppe Bilotta
2005-10-06 6:43 ` what's next for the linux kernel? Steven Rostedt
2005-10-05 19:54 ` Bernd Petrovitsch
2005-10-07 0:11 ` Joe Bob Spamtest
2005-10-05 14:52 ` linux-os (Dick Johnson)
2005-10-05 14:57 ` Lennart Sorensen
2005-10-05 15:26 ` linux-os (Dick Johnson)
2005-10-05 15:24 ` Luke Kenneth Casson Leighton
2005-10-05 15:30 ` Lennart Sorensen
2005-10-05 15:42 ` Luke Kenneth Casson Leighton
2005-10-05 15:55 ` Lennart Sorensen
2005-10-06 15:41 ` Ragnar Hojland Espinosa
2005-10-05 14:55 ` David Leimbach
2005-10-05 16:25 ` Bodo Eggert
2005-10-05 16:41 ` David Leimbach
2005-10-05 19:21 ` Nix
2005-10-05 23:23 ` Luke Kenneth Casson Leighton
2005-10-06 9:53 ` grundig
2005-10-06 10:45 ` Tomasz Kłoczko
2005-10-06 15:18 ` Greg Norris
2005-10-05 20:27 ` Marc Perkel
2005-10-05 20:41 ` Julian Blake Kongslie
2005-10-05 20:51 ` Bas Westerbaan
2005-10-05 20:57 ` Julian Blake Kongslie
[not found] ` <4Uis4-4pZ-5@gated-at.bofh.it>
2005-10-05 17:43 ` Bodo Eggert
2005-10-05 19:27 ` Nix
2005-10-05 20:04 ` Bodo Eggert
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=1128695400.28620.42.camel@icampbell-debian \
--to=ijc@hellion.org.uk \
--cc=bilotta78@hotpop.com \
--cc=linux-kernel@vger.kernel.org \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®