[darcs-users] can we get rid of perl requirement in our test suite?

Nathan Gray kolibrie at graystudios.org
Wed May 27 02:32:07 UTC 2009


On Tue, May 26, 2009 at 09:58:50PM +0100, Eric Kow wrote:
> In case any Perl hackers want to help us translate this to shell, or
> maybe Haskell if need be:
> 
> # succeeds if there are hard links
> use File::Basename;
> $res=0;
> while ($fn=<'$1'/*>) {
>   $fn2="'$2'/" . basename($fn);
>   @fd1=lstat($fn);
>   @fd2=lstat($fn2);
>   $res += ($fd1[1] != $fd2[1]);
> };
> exit($res);

Looks like that is comparing all similarly named files between
two directories ($1 and $2) and determining if their inode numbers
(the second element returned from lstat is the inode number) are
the same.

-kolibrie

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20090526/20beae25/attachment.pgp>


More information about the darcs-users mailing list