Expose file size, mode, etc from `pathlib.Path.info`
Open
Nobody has claimed this yet.
stdlib
topic-pathlib
type-feature
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
Feature or enhancement
Proposal:
As a pathlib user, I desire methods that retrieve the file mode, size, access time and modify time.
We can implement these as methods of Path.info.
def mode(self, *, follow_symlinks: bool = True) -> int: ...
def size(self, *, follow_symlinks: bool = True) -> int: ...
def access_time(self, *, follow_symlinks: bool = True) -> datetime: ...
def modify_time(self, *, follow_symlinks: bool = True) -> datetime: ...
Has this already been discussed elsewhere?
I have already discussed this feature proposal on Discourse
Links to previous discussion of this feature:
https://discuss.python.org/t/expose-file-size-mode-etc-from-pathlib-path-info/103828
Linked PRs
- gh-139175
- gh-139183
- gh-139279
- gh-140155
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Path.info documentation and the linked Discourse discussion to understand the proposed API. Review linked PRs gh-139175, gh-139183, gh-139279, and gh-140155 before making changes; the work is done when the proposal has an agreed implementation and the requested Path.info methods are supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 20/100