python-fhs
Python module for using the FHS and XDG basedir paths.
|
◆ write_temp()
Open a temporary file for writing. The file is automatically removed when the program exits. If this function is used in a with statement, the file is removed when the statement finishes. Unlike other write_* functions, this one has no option to get the filename without opening the file, because that is a security risk for temporary files. However, the returned object is really a wrapper that looks like a file, but has one extra attribute: "filename". This can be used in cases where for other file types "opened = False" would be appropriate. It also has an extra method: "remove". This takes no arguments and removes the file immediately. "remove" should not be called multiple times.
Definition at line 892 of file fhs.py.
Here is the caller graph for this function:
![]() |