in reply to Test to see if directories are the same
(stat)[0, 1] are the device number and the inode number, which together uniquely identify a file or directory.sub matching_paths { my($path1, $path2) = @_; my(@stat1) = stat $path1; my(@stat2) = stat $path2; return $stat1[0] == $stat2[0] && $stat1[1] == $stat2[1]; }
I don't know how portable this solution is, however.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Test to see if directories are the same
by merlyn (Sage) on Jan 17, 2001 at 23:54 UTC | |
by tilly (Archbishop) on Jan 18, 2001 at 00:11 UTC | |
by danger (Priest) on Jan 18, 2001 at 00:26 UTC |