diff options
author | Charles Machalow <csm10495@gmail.com> | 2022-11-22 17:19:34 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-22 17:19:34 (GMT) |
commit | 1b2de89bce7eee3c63ce2286f071db57cd2cfa22 (patch) | |
tree | 34dfc872d34c8468edb2b7ef37cb89055097846e /Lib/posixpath.py | |
parent | c2102136be569e6fc8ed90181f229b46d07142f8 (diff) | |
download | cpython-1b2de89bce7eee3c63ce2286f071db57cd2cfa22.zip cpython-1b2de89bce7eee3c63ce2286f071db57cd2cfa22.tar.gz cpython-1b2de89bce7eee3c63ce2286f071db57cd2cfa22.tar.bz2 |
gh-99547: Add isjunction methods for checking if a path is a junction (GH-99548)
Diffstat (limited to 'Lib/posixpath.py')
-rw-r--r-- | Lib/posixpath.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Lib/posixpath.py b/Lib/posixpath.py index 5b4d78b..737f8a5 100644 --- a/Lib/posixpath.py +++ b/Lib/posixpath.py @@ -35,7 +35,7 @@ __all__ = ["normcase","isabs","join","splitdrive","split","splitext", "samefile","sameopenfile","samestat", "curdir","pardir","sep","pathsep","defpath","altsep","extsep", "devnull","realpath","supports_unicode_filenames","relpath", - "commonpath"] + "commonpath", "isjunction"] def _get_sep(path): @@ -169,6 +169,16 @@ def islink(path): return False return stat.S_ISLNK(st.st_mode) + +# Is a path a junction? + +def isjunction(path): + """Test whether a path is a junction + Junctions are not a part of posix semantics""" + os.fspath(path) + return False + + # Being true for dangling symbolic links is also useful. def lexists(path): |