I
ivowel
is it possible for perl to open a file in unix not knowing its
filename, but knowing its inode?
sincerely,
/iaw
filename, but knowing its inode?
sincerely,
/iaw
is it possible for perl to open a file in unix not knowing its
filename, but knowing its inode?
John said:chomp( my @files = `find / -inum $inode 2>/dev/null` );
John said:is it possible for perl to open a file in unix not knowing its
filename, but knowing its inode?
Sure:
No.
my $inode = 12345;
# Could be more then one file with the same inode
chomp( my @files = `find / -inum $inode 2>/dev/null` );
@files or die "Cannot find a file with inode $inode.\n";
open my $fh, '<', $files[ 0 ] or die "Cannot open $files[0]: $!";
is it possible for perl to open a file in unix not knowing its
filename, but knowing its inode?
yikes. I was storing inodes because I wanted to speed up file access.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.