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

Attachment: signature.asc
Description: Digital signature

_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users

Reply via email to