The posix Module

(Implementation, Unix/POSIX only) The posix module is an implementation module used by the os module on Unix and other POSIX systems. While everything in here can be (and should be) accessed via the os module, you may wish to explicitly refer to this module in situations where you want to make it clear that you expect POSIX behavior. Example 12-18 demonstrates.

Example 12-18. Using the posix Module

File: posix-example-1.py

import posix

for file in posix.listdir("."):
    print file, posix.stat(file)[6]

aifc-example-1.py 314
anydbm-example-1.py 259
array-example-1.py 48

Get Python Standard Library now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.