All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jose Celestino <japc@co.sapo.pt>
To: Giuseppe Bilotta <bilotta78@hotpop.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 'Undeleting' an open file
Date: Fri, 7 Oct 2005 15:25:47 +0100	[thread overview]
Message-ID: <20051007142546.GC4404@co.sapo.pt> (raw)
In-Reply-To: <8qo997np4h6n.1ihs13ptrx2y2.dlg@40tude.net>

Words by Giuseppe Bilotta [Fri, Oct 07, 2005 at 04:14:27PM +0200]:
> 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?
> 

Well, you can go to /proc/$PID_OF_PROCESSING_OPENING_THE_FILE/fd/

do an ls -la, identify the fd of the file deleted but still open
and do a cp $FD ~/my_deleted_file

Example:

[japc@morgoth:/proc/3743/fd]$ ls -al
total 4
dr-x------  2 japc japc  0 Oct  7 15:25 .
dr-xr-xr-x  4 japc japc  0 Oct  7 15:23 ..
lr-x------  1 japc japc 64 Oct  7 15:25 0 -> /dev/null
l-wx------  1 japc japc 64 Oct  7 15:25 1 -> /home/japc/.xsession-errors
l-wx------  1 japc japc 64 Oct  7 15:25 2 -> /home/japc/.xsession-errors
lr-x------  1 japc japc 64 Oct  7 15:25 255 -> /usr/bin/startkde
[japc@morgoth:/proc/3743/fd]$ cp 255 ~/startkde


-- 
Jose Celestino | http://xpto.org/~japc/files/japc-pgpkey.asc
----------------------------------------------------------------
"Thus the metric system did not really catch on in the States, unless you count
the increasing popularity of the nine-millimeter bullet." -- Dave Barry

  parent reply	other threads:[~2005-10-07 14:25 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 [this message]
2005-10-07 14:30                     ` Ian Campbell
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=20051007142546.GC4404@co.sapo.pt \
    --to=japc@co.sapo.pt \
    --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 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.