I'm not technical enough here to try to argue which it is closer to. We can say it's like so and so in implementation, but I just liken it a certain way.
I think for regular users it makes most sense to just have a specific function rather than expecting folks to know concept similarities... a simple function that does one thing well is best... But that's just my opinion.
Funny enough in PowerShell, for prints an "l" for both symlinks and junctions.. so it kind of thinks of it as a link of some sort too I guess.
Is it that much of a waste to just return False on posix? I mean it's a couple lines and just maintains api.. and in theory can be more clear to some.
An alternative is to make it just available on Windows... But I'd personally prefer a function that returns False on other than Windows to maintain api. The docs can even say that it can only return False on non-Windows.
On 11/8/22, Charles Machalow <csm10495@gmail.com> wrote:
> I tend to prefer adding isjunction instead of changing ismount since I tend
> to not think about junctions as being mounts (but closer to symlinks)..
Junctions are mount points that are similar to Unix bind mounts where
it counts -- in the behavior that's implemented for them in the
kernel. This behavior isn't exclusive to just volume mount points.
It's implemented the same for all junctions, and it's distinctly
different from symlinks.
There are times that I want to handle non-root mount points as if
they're symlinks, such as deleting them in rmtree(). There are times
where I want to handle them distinctly from symlinks, such as adding
code in copytree() to copy a junction.
> I guess either way the closeness of the concepts is a different story than
> the specific ask here. In other words: for clarity, adding a specific
> method makes the most sense to me.
Adding a posixpath.isjunction() function that's always false seems a
waste compared to common support for os.path.ismount(). On the other
hand, the realpath() call in posixpath.ismount() is expensive, so
calling os.path.ismount() to decide how to handle a directory would be
expensive on POSIX.