Creates temporary files and folders and makes a best effort to remove
them on exit (or sooner). Typically only a single instance of this class
will exist ("manager" variable in this module below)
|
__init__(self,
prefix="omero")
Initializes a TempFileManager instance with a userDir containing the
given prefix value, or "omero" by default. |
source code
|
|
|
|
|
tmpdir(self)
Returns a platform-specific user-writable temporary directory |
source code
|
|
|
username(self)
Returns the current OS-user's name |
source code
|
|
|
pid(self)
Returns some representation of the current process's id |
source code
|
|
|
access(self,
dir)
Returns True if the current user can write to the given directory |
source code
|
|
|
create(self,
dir)
If the given directory doesn't exist, creates it (with mode 0700) and
returns True. |
source code
|
|
|
gettempdir(self)
Returns the directory under which all temporary files and folders
will be created. |
source code
|
|
|
create_path(self,
prefix,
suffix,
folder=False,
text=False,
mode="r+")
Uses tempfile.mkdtemp and tempfile.mkstemp to create temporary
folders and files, respectively, under self.dir |
source code
|
|
|
remove_path(self,
name)
If the given path is under self.dir, then it is deleted whether file
or folder. |
source code
|
|
|
|
|
clean_userdir(self)
Attempts to delete all directories under self.userdir other than the
one owned by this process. |
source code
|
|
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|