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

Eric Kow kowey at darcs.net
Wed May 27 08:36:48 UTC 2009


On Wed, May 27, 2009 at 11:15:03 +1000, Trent W. Buck wrote:
> > # 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);
> >
> > Ideas? Surely something like ls -l should help us do what we want?
> 
> It is always wrong to use ls(1) output programmatically.
> http://mywiki.wooledge.org/ParsingLs
> 
> If we're lucky, stat(1) is part of POSIX.

If we're not lucky, how about a small wrapper around the Haskell
System.Posix.getFileStatus?  It may also wind up being useful for
other scripts.

In case anybody is wondering, I believe the prize is making it easier
for Windows users to run the test suite: fewer requirements.

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
-------------- 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/20090527/045f63c4/attachment.pgp>


More information about the darcs-users mailing list