in reply to Retriving Filename from Filehandle
As others have pointed out, you should keep track up front but if that isn't possible a brute force approach would be to use find and the inode number:
#!/usr/bin/perl -w use File::Find; open( FH, "/etc/motd" ) || die "cannot open file ($!)\n"; $INO = (lstat(FH))[1]; close( FH ); find( \&wanted, '/etc' ); sub wanted { my( $ino ) = (lstat($_))[1]; if( $ino == $INO ) { print $File::Find::name, "\n"; } }
Caveats to this approach apply all over the place but it could be usefull if you have some inkling of where in the filesytem to start looking
-derby
|
|---|