FileTools[Binary][OpenTemporaryFile] - open a temporary file for binary operations
|
Calling Sequence
|
|
OpenTemporaryFile(prefix)
|
|
Parameters
|
|
prefix
|
-
|
(optional) string prefix for the temporary file
|
|
|
|
|
Description
|
|
•
|
The OpenTemporaryFile() command creates and opens a temporary file. It returns a string that is the filename of the temporary file. The name of the file is of the form , where each is replaced with a random character.
|
•
|
The OpenTemporaryFile(prefix) command uses prefix as a template for the temporary file. The name of the file is of the form where each is replaced with a random character.
|
•
|
The current implementation of OpenTemporaryFile is not secure. Between generating the unique filename and creating the file, another process may be able to create a file with the same name. By doing so, the other process can read information from or write information into the file.
|
•
|
If no temporary file can be created, an exception is raised.
|
|
|
Examples
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
>
|
|
>
|
|
>
|
|
|
|
Download Help Document
Was this information helpful?