directory create temp
Utility Library
This function will create a dedicated temporary directory, located as a subdirectory where all othe other temp files
are located in your system. Under Windows, the new directory is created in C:\Users\Zur Bonsen Georg\AppData\Local\Temp\b4p\B4P_XXXXXX\
where XXXXXX stands for six random capital letters. Under Linux and MacOS, the new directory is created in /tmp/b4p/B4P_XXXXXX/.
Advice: It is recommended to remove that directory including all contents when you are done using it. Do not count on referring to that
directory in a later B4P session and do not use it to store your valuable data for later use. The temp directory is likely cleaned up in regular time intervals.
Under normal conditions, the 'Utility Library' is loaded automatically, so no 'include(...)' call is needed.
0
Type | Description |
---|---|
string | Path name This is the full path name to the directory name just created. A directory separator symbol (slash or backslash) has already been added at the end. |
dir[] = directory create temp();
echo("Created temp directory '", dir[], "'.");
// Do something
table initialize ( little table, { Name, Andy, Beata, Charly, Daniela } );
table save( little table, dir[] + "Little Table.csv" );
// pause; // Remove comment symbols so you can look where the file has been saved.
directory delete recursive( dir[] ); // Clean up: Remove the temp directory
Created temp directory 'C:\Users\zur-b\AppData\Local\TEMP\b4p\B4P_4CQ5XY\'.