in reply to Re^6: Bad file descriptor when trying to close file handle
in thread Bad file descriptor when trying to close file handle
I know about inodes
But the question remains:
How can I revive/move an "invisible" file into the directory?
link doesn't seem to accept FHs.
OUTPUT:use strict; use warnings; use Data::Dump qw/ddx/; use autodie; my $dir = "/tmp"; my $file = "$dir/tst_unlink"; open my $fh, ">>", $file; print $fh "ENTRY ".__LINE__; ddx <$file*>; unlink $file; print $fh "ENTRY ".__LINE__; ddx <$file*>; eval { link $fh, "${file}_new"; } or warn $@; eval { link $file, "${file}_new"; } or warn $@; ddx <$file*>; __DATA__
# open_unlink.pl:16: "/tmp/tst_unlink" # open_unlink.pl:22: () Can't link($fh, '/tmp/tst_unlink_new'): Datei oder Verzeichnis nicht g +efunden at ./open_unlink.pl line 24 Can't link('/tmp/tst_unlink', '/tmp/tst_unlink_new'): Datei oder Verze +ichnis nicht gefunden at ./open_unlink.pl line 26 # open_unlink.pl:29: ()
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
PS: FWIW: I was guessing, I can't run a full diagnosis for every fuzzy bug question, even after reading it thrice.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Bad file descriptor when trying to close file handle
by ikegami (Patriarch) on Mar 03, 2022 at 16:05 UTC | |
by ikegami (Patriarch) on Mar 03, 2022 at 16:11 UTC | |
by LanX (Saint) on Mar 04, 2022 at 13:59 UTC |