2727
2828@six .python_2_unicode_compatible
2929class TempFS (OSFS ):
30- """A temporary filesystem on the OS."""
30+ """A temporary filesystem on the OS.
31+
32+ Temporary filesystems are created using the `tempfile.mkdtemp`
33+ function to obtain a temporary folder in an OS-specific location.
34+ You can provide an alternative location with the ``temp_dir``
35+ argument of the constructor.
36+
37+ Examples:
38+ Create with the constructor::
39+
40+ >>> from fs.tempfs import TempFS
41+ >>> tmp_fs = TempFS()
42+
43+ Or via an FS URL::
44+
45+ >>> import fs
46+ >>> tmp_fs = fs.open_fs("temp://")
47+
48+ Use a specific identifier for the temporary folder to better
49+ illustrate its purpose::
50+
51+ >>> named_tmp_fs = fs.open_fs("temp://local_copy")
52+ >>> named_tmp_fs = TempFS(identifier="local_copy")
53+
54+ """
3155
3256 def __init__ (
3357 self ,
@@ -43,7 +67,7 @@ def __init__(
4367 identifier (str): A string to distinguish the directory within
4468 the OS temp location, used as part of the directory name.
4569 temp_dir (str, optional): An OS path to your temp directory
46- (leave as `None` to auto-detect)
70+ (leave as `None` to auto-detect).
4771 auto_clean (bool): If `True` (the default), the directory
4872 contents will be wiped on close.
4973 ignore_clean_errors (bool): If `True` (the default), any errors
0 commit comments