fs.wrap¶
-
class
fs.wrap.
WrapCachedDir
(wrap_fs)¶ Caches filesystem directory information.
This filesystem caches directory information retrieved from a scandir call. This may speed up code that calls
isdir
,isfile
, orgettype
too frequently.Note
Using this wrap will prevent changes to directory information being visible to the filesystem object. Consequently it is best used only in a fairly limited scope where you don’t expected anything on the filesystem to change.
-
class
fs.wrap.
WrapReadOnly
(wrap_fs)¶ Makes a Filesystem read-only. Any call that would would write data or modify the filesystem in any way will raise a
ResourceReadOnly
exception.
-
fs.wrap.
cache_directory
(fs)¶ Make a filesystem that caches directory information.
Parameters: fs – A FS object. Returns: A filesystem that caches results of scandir
,isdir
and other methods which read directory information.
-
fs.wrap.
read_only
(fs)¶ Make a read-only filesystem.
Parameters: fs – A FS object. Returns: A read only version of fs
.