f$ = GetTempFileName()
It is preferable to use this function if you need to work with temporary files because each operating system stores its temporary files in a different place. By using this function you can be sure that your temporary files end up in the correct folder.
Please note that this function will not only return a file name but it
will also create an empty file for you. This is done to avoid any possible
race conditions with other applications which might want to store their
own temporary file under the very same name. This is not possible if the
file already exists so this is why GetTempFileName()
will create an empty
file for you.
f$ = GetTempFileName() OpenFile(1, f$, #MODE_WRITE) WriteLine(1, "My temporary file") CloseFile(1)The code above will obtain the name of a temporary file and then write some text into it. The file will be automatically deleted when Hollywood terminates.