Support for pathlib.Path.link_to()
See original GitHub issuePython 3.8 has added a new method to pathlib library: Path.link_to() for creating hard links (https://docs.python.org/3/library/pathlib.html#pathlib.Path.link_to). I think that it is not supported by pyfakefs yet (v. 4.3.3).
It would be nice to mock this method since it is an easy way to create hard links.
Maybe it would be a good idea to include a FakeFilesystem.create_link() method for creating hard links (similar to FakeFilesystem.create_symlink() for soft links).
Thank you.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
pathlib — Object-oriented filesystem paths — Python 3.11.1 ...
New in version 3.4. This module offers classes representing filesystem paths with semantics appropriate for different operating systems.
Read more >Getting the target of a symbolic link with pathlib - Stack Overflow
Path.relative_to() as name says, transforms existing Path to relative one, without checking whether symbolic link destination path starts with ...
Read more >Add support for pathlib.Path type #97 - omry/omegaconf - GitHub
Once stronger typing is implemented in the library, consider adding support for the pathlib.Path type. Motivation: paths are often found in ...
Read more >Python Path – How to Use the Pathlib Module with Examples
Before we jump into this, Pathlib divides the filesystem paths into two different classes that represent two types of path objects: Pure Path...
Read more >Python 3's pathlib Module: Taming the File System
In this tutorial, you will see how to work with file paths—names of directories and files—in Python. You will learn new ways to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Ok, I had thought
pathlib2is not used anymore (it is definitely not needed in Python 3.8). Making a separate accessor forpathlib2is probably not worth it. I could just remove the check forpathlib2and let it fail if you usepathlib2instead ofpathlib.This is probably the best option, because if you want to use
link_to, you cannot usepathlib2, or you would get the same exception.Excellent and quick work! I have installed it from master. Thanks a lot. Happy new year!