Muscat.Helpers.IO.TemporaryDirectory module¶
- class TemporaryDirectory[source]¶
Bases:
object
Class to generate and to destroy a temporary directory
- classmethod GetFullFilenameOnTempDirectory(filename: str) str [source]¶
Return an absolute path to filename in the temporary directory if pathname is an absolute path then this function return path
- Parameters:
filename (str) – relative (to the temp path) or absolute filename
- Returns:
full filename (with path) in the temporary directory
- Return type:
str
- classmethod GetTempPath(onRam: bool = False) str [source]¶
Get and Create (if needed) a temporary directory
- Parameters:
onRam (bool, optional, default False) – if true an on ram directory is created (only on linux ), by default None, on disk
- Returns:
Path to the temporary directory
- Return type:
str
- classmethod SetTempPath(path: str) None [source]¶
Set the temporary path from the given path
- Parameters:
path (str) – temporary path to be created, no error is raised if the directory already exists.
- createdOnRam = False¶
- path: str = None¶
- prefix: str = 'Muscat_Test_Directory_'¶