ikegami has asked for the wisdom of the Perl Monks concerning the following question:
According to perlport's note on stat, the device and inode information returned by stat are not meaningful or reliable on some systems. Is there a way of knowing if they are meaningful on the current system? Perhaps a Config variable contains this information?
Update: Background info:
I'm trying to determine if a given file has already been read and processed. If it has, I'll just use the data in memory instead of processing the file a second time. False negatives are acceptable. False positives are not.
sub canonize_file_name { ??? } my $id = canonize_file_name($file_name); if (not exists $forest{$id}) { $forest{$id} = Tree->new($file_name); } return $forest{$id};
I plan to use File::Spec's rel2abs and case_tolerant, but I thought I might use the device+inode on systems where it is supported. Is it possible to determine if this is such a system? Is there an existing module that does any of this?
Update: Progress:
Cache::AgainstFile looks good. Still need to handle canonisation.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Is device+inode meaningful?
by gaal (Parson) on Dec 30, 2006 at 08:12 UTC | |
by ikegami (Patriarch) on Dec 30, 2006 at 08:23 UTC | |
by pajout (Curate) on Dec 30, 2006 at 18:42 UTC | |
|
Re: Is device+inode meaningful?
by ysth (Canon) on Dec 31, 2006 at 03:35 UTC | |
|
Re: Is device+inode meaningful?
by aufflick (Deacon) on Jan 02, 2007 at 01:29 UTC |