summaryrefslogtreecommitdiffstats
path: root/Lib/posixpath.py
diff options
context:
space:
mode:
authorBrian Curtin <brian@python.org>2012-12-26 13:03:03 (GMT)
committerBrian Curtin <brian@python.org>2012-12-26 13:03:03 (GMT)
commit490b32a3976d84eaf1d6ca8cdcb00eac0ce5055b (patch)
treef110633e5ef37e78cecac8701874bb7a02c250bf /Lib/posixpath.py
parent2bf61abe02d578a9812cb13d4d71e14f481c4cb5 (diff)
downloadcpython-490b32a3976d84eaf1d6ca8cdcb00eac0ce5055b.zip
cpython-490b32a3976d84eaf1d6ca8cdcb00eac0ce5055b.tar.gz
cpython-490b32a3976d84eaf1d6ca8cdcb00eac0ce5055b.tar.bz2
Fix #11939. Set st_dev attribute on Windows to simplify os.path.samefile.
By setting the st_dev attribute, we can then remove some Windows-specific code and move os.path.samefile/sameopenfile/samestat to Lib/genericpath.py so all platforms share the same implementation.
Diffstat (limited to 'Lib/posixpath.py')
-rw-r--r--Lib/posixpath.py28
1 files changed, 0 insertions, 28 deletions
diff --git a/Lib/posixpath.py b/Lib/posixpath.py
index eb5f45f..3c83704 100644
--- a/Lib/posixpath.py
+++ b/Lib/posixpath.py
@@ -177,34 +177,6 @@ def lexists(path):
return True
-# Are two filenames really pointing to the same file?
-
-def samefile(f1, f2):
- """Test whether two pathnames reference the same actual file"""
- s1 = os.stat(f1)
- s2 = os.stat(f2)
- return samestat(s1, s2)
-
-
-# Are two open files really referencing the same file?
-# (Not necessarily the same file descriptor!)
-
-def sameopenfile(fp1, fp2):
- """Test whether two open file objects reference the same file"""
- s1 = os.fstat(fp1)
- s2 = os.fstat(fp2)
- return samestat(s1, s2)
-
-
-# Are two stat buffers (obtained from stat, fstat or lstat)
-# describing the same file?
-
-def samestat(s1, s2):
- """Test whether two stat buffers reference the same file"""
- return s1.st_ino == s2.st_ino and \
- s1.st_dev == s2.st_dev
-
-
# Is a path a mount point?
# (Does this work for all UNIXes? Is it even guaranteed to work by Posix?)