module documentation
(source)

Interface for accessing the file system with automatic caching.

The idea is to cache the results of any file system state reads during a single transaction. This has two main benefits:

  • This avoids redundant syscalls, as we won't perform the same OS operations multiple times.
  • This makes it easier to reason about concurrent FS updates, as different operations targeting the same paths can't report different state during a transaction.

Note that this only deals with reading state, not writing.

Properties maintained by the API:

  • The contents of the file are always from the same or later time compared to the reported mtime of the file, even if mtime is queried after reading a file.
  • Repeating an operation produces the same result as the first one during a transaction.
  • Call flush() to start a new transaction (flush the caches).

The API is a bit limited. It's easy to add new cached operations, however. You should perform all file system reads through the API to actually take advantage of the benefits.

Class ​File​System​Cache No class docstring; 0/11 instance variable, 5/15 methods documented
Function copy​_os​_error Undocumented
def copy_os_error(e): (source)

Undocumented

Parameters
e:OSErrorUndocumented
Returns
OSErrorUndocumented