Why does pathlib not have is_readable() & things like that?
Adam Funk
a24061 at ducksburg.com
Tue Apr 26 09:30:14 EDT 2016
I recently discovered pathlib in the Python 3 standard library, & find
it very useful, but I'm a bit surprised that it doesn't offer things
like is_readable() and is_writable. Is there a good reason for that?
I've been improvising with things like this:
import pathlib, os
path = pathlib.Path('some/directory')
writable = os.access(str(path), os.W_OK | os.X_OK)
Is that the best way to do it?
--
Unix is a user-friendly operating system. It's just very choosy about
its friends.
More information about the Python-list
mailing list