[issue43800] os.fwalk is not exposed on macOS

2021-04-10 Thread ntninja


New submission from ntninja :

Is has come to my attention that the `os.fwalk` function has been missing from 
the standard library on Python for macOS since 3.6, even though macOS should 
support the necessary OS-interfaces (as specified in POSIX.1-2008) to support 
that function it just doesn't appear to exist.

Due to lack of the required hardware I can unfortunately not even test this 
myself.

--
components: Library (Lib)
messages: 390710
nosy: ntninja
priority: normal
severity: normal
status: open
title: os.fwalk is not exposed on macOS
type: behavior

___
Python tracker 
<https://bugs.python.org/issue43800>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39533] Use `statx(2)` system call on Linux for extended `os.stat` information

2020-05-17 Thread ntninja


ntninja  added the comment:

I thought this might be the case, I'll look into adapting the patch accordingly 
then.

--

___
Python tracker 
<https://bugs.python.org/issue39533>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39533] Use `statx(2)` system call on Linux for extended `os.stat` information

2020-03-23 Thread ntninja


Change by ntninja :


--
keywords: +patch
pull_requests: +18486
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19125

___
Python tracker 
<https://bugs.python.org/issue39533>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39533] Use `statx(2)` system call on Linux for extended `os.stat` information

2020-02-02 Thread ntninja


New submission from ntninja :

Background: For a long time several Linux filesystems have been tracking two 
extra bits of information. The file attributes bits[1] and the file creation 
time (aka crtime aka btime aka birthtime)[2]. Before Linux 4.11 accessing these 
required secret knowledge (ioctl numbers) or access to unstable interfaces 
(debugfs). However since that version the statx(2) system call[3] has finally 
been added (it has a long history), which exposes these two fields adds 
(struct) space for potentially more.

Since CPython already exposes `st_birthtime` on FreeBSD and friends, I think it 
would be fair to also expose this field on Linux. As the timestamp value is 
only available on some file systems and configurations it is not guaranteed 
that the system call will return a value for btime at all. I suppose the field 
should be set to `None` in that case. In my opinion it should also become a 
regular field (available on all platforms) since, with this addition, we now 
have a suitable value to return on every major platform CPython targets: 
`stx_btime` on Linux, `st_birthtime` on macOS/FreeBSD and `st_ctime` on Windows.

`stx_attributes` could be exposed as a new `st_attributes` flag specific to 
Linux as there is no equivalent on other platforms to my knowledge (Window's 
`st_file_attributes` is similar in some aspects but has a completely different 
format and content).

There is a Python script I created, that calls statx(2) using ctypes here: 
https://github.com/ipfs/py-datastore/blob/e566d40a8ca81d8628147e255fe7830b5f928a43/datastore/filesystem/util/statx.py
It may be useful as a reference when implementing this in C.

  [1]: https://man.cx/chattr(1)
  [2]: https://unix.stackexchange.com/a/50184/47938
  [3]: https://man.cx/statx(2)

--
messages: 361265
nosy: ntninja
priority: normal
severity: normal
status: open
title: Use `statx(2)` system call on Linux for extended `os.stat` information
type: enhancement

___
Python tracker 
<https://bugs.python.org/issue39533>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com