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, orgettypetoo frequently.注解
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
ResourceReadOnlyexception.
-
fs.wrap.cache_directory(fs)¶ Make a filesystem that caches directory information.
参数: fs – A FS object. 返回: A filesystem that caches results of scandir,isdirand other methods which read directory information.
-
fs.wrap.read_only(fs)¶ Make a read-only filesystem.
参数: fs – A FS object. 返回: A read only version of fs.