Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
129aaa37
Commit
129aaa37
authored
Nov 12, 1991
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added samefile() function.
parent
ef2a9f43
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
Lib/posixpath.py
Lib/posixpath.py
+28
-0
No files found.
Lib/posixpath.py
View file @
129aaa37
...
...
@@ -100,6 +100,34 @@ def islink(path):
return
stat
.
S_ISLNK
(
st
[
stat
.
ST_MODE
])
# Are two filenames really pointing to the same file?
#
def
samefile
(
f1
,
f2
):
s1
=
posix
.
stat
(
f1
)
s2
=
posix
.
stat
(
f2
)
return
samestat
(
s1
,
s2
)
# Are two open files really referencing the same file?
# (Not necessarily the same file descriptor!)
# XXX Oops, posix.fstat() doesn't exist yet!
#
def
sameopenfile
(
fp1
,
fp2
):
s1
=
posix
.
fstat
(
fp1
)
s2
=
posix
.
fstat
(
fp2
)
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
.
STD_DEV
]
# Subroutine and global data used by ismount().
_mounts
=
[]
def
_getmounts
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment