[plt-scheme] When are two paths equal?

From: Eli Barzilay (eli at barzilay.org)
Date: Tue Sep 30 13:54:54 EDT 2008

On Sep 30, Greg Woodhouse wrote:
> I want to write a utility that recursively compares the contents of
> two directory trees. I was going to check to see if applying
> path->string to the members of the list of (relative) paths returned
> by directory-list were equal?, but then I wonder if this is
> (guaranteed to be) true when the paths themselves are equal? This
> would be nice because I could use member? instead opf writing my own
> test. Then again, I will probably have tests comparing file sizes
> and other attributes, too.

You probably want to use something like `explode-path' to avoid issues
with slashes or backslashes on windows.  Also, it might not be needed
in your case since you're building the paths yourself, but in general
you'd want to simplify them too (`simplify-path' with #t for the
second argument).

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

Posted on the users mailing list.