diff options
author | Guido van Rossum <guido@python.org> | 1998-05-02 00:47:09 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-05-02 00:47:09 (GMT) |
commit | b485224d82e2dc76c10e940e364425ab58524847 (patch) | |
tree | 686ea3f941ed2823474a9bfb012b4696091cf5e7 /Lib | |
parent | e365a590d4277fac207df80ff4364e91089a0aa4 (diff) | |
download | cpython-b485224d82e2dc76c10e940e364425ab58524847.zip cpython-b485224d82e2dc76c10e940e364425ab58524847.tar.gz cpython-b485224d82e2dc76c10e940e364425ab58524847.tar.bz2 |
REMOVE samefile(), sameopenfile(), samestat() -- these cannot be made
to work reliably (at least I wouldn't know how).
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/dospath.py | 26 | ||||
-rw-r--r-- | Lib/ntpath.py | 30 |
2 files changed, 0 insertions, 56 deletions
diff --git a/Lib/dospath.py b/Lib/dospath.py index 803ddb0..5dbda89 100644 --- a/Lib/dospath.py +++ b/Lib/dospath.py @@ -166,32 +166,6 @@ def isfile(path): return stat.S_ISREG(st[stat.ST_MODE]) -# Are two filenames really pointing to the same file? - -def samefile(f1, f2): - 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!) -# XXX THIS IS BROKEN UNDER DOS! ST_INO seems to indicate number of reads? - -def sameopenfile(fp1, fp2): - s1 = os.fstat(fp1.fileno()) - s2 = os.fstat(fp2.fileno()) - return samestat(s1, s2) - - -# Are two stat buffers (obtained from stat, fstat or lstat) -# describing the same file? - -def samestat(s1, s2): - return s1[stat.ST_INO] == s2[stat.ST_INO] and \ - s1[stat.ST_DEV] == s2[stat.ST_DEV] - - # Is a path a mount point? # XXX This degenerates in: 'is this the root?' on DOS diff --git a/Lib/ntpath.py b/Lib/ntpath.py index 2543890..7bec2f7 100644 --- a/Lib/ntpath.py +++ b/Lib/ntpath.py @@ -189,36 +189,6 @@ def isfile(path): return stat.S_ISREG(st[stat.ST_MODE]) -# 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!) -# XXX THIS IS BROKEN UNDER DOS! ST_INO seems to indicate number of reads? - -def sameopenfile(fp1, fp2): - """Test whether two open file objects reference the same file (may not -work correctly)""" - s1 = os.fstat(fp1.fileno()) - s2 = os.fstat(fp2.fileno()) - 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[stat.ST_INO] == s2[stat.ST_INO] and \ - s1[stat.ST_DEV] == s2[stat.ST_DEV] - - # Is a path a mount point? # XXX This degenerates in: 'is this the root?' on DOS |