How to test if two strings point to the same file or directory?

Tim Chase python.list at tim.thechases.com
Sat Dec 16 20:25:44 EST 2006


> Comparing file system paths as strings is very brittle. Is there a
> better way to test if two paths point to the same file or directory
> (and that will work across platforms?)

	os.path.samefile(filename1, filename2)
	os.path.sameopenfile(fileobject1, fileobject2)

-tkc






More information about the Python-list mailing list