On Sat, 16 Dec 2006 17:02:04 -0800, Sandra-24 wrote: > Comparing file system paths as strings is very brittle.
Why do you say that? Are you thinking of something like this? /home//user/somedirectory/../file /home/user/file Both point to the same file. > Is there a > better way to test if two paths point to the same file or directory > (and that will work across platforms?) How complicated do you want to get? If you are thinking about aliases, hard links, shortcuts, SMB shares and other complications, I'd be surprised if there is a simple way. But for the simple case above: >>> import os >>> path = '/home//user/somedirectory/../file' >>> os.path.normpath(path) '/home/user/file' -- Steven. -- http://mail.python.org/mailman/listinfo/python-list