On Mon, Nov 07, 2022 at 07:31:36PM -0000, Charles Machalow wrote:

> I propose adding a mechanism to both pathlib.Path and os.path to check 
> if a given path is a junction or not. Currently is_symlink/islink 
> return False for junctions.

+1 on a function is_junction.

I am neutral on the question of whether that function should:

1. only exist on Windows,
2. or exist on other platforms but always return False.

Prior art suggests the second is probably better: when Python doesn't 
support symbolic links, `os.islink` exists but always returns False.

https://docs.python.org/3/library/os.path.html#os.path.islink

I am also neutral on whether ismount() on Windows should always return 
True for junctions, as well as mount points. I leave that to Windows 
experts to decide.

-1 on adding a flag parameter to existing functions.


-- 
Steve
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/M36XXF4QZ6VJJSTEDPOTAGEODC35NVLM/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to