Resolve a file path, retrieve the directory portion of a file name, or create a temporary file.
These functions are exported by the KS module.
Filename := FileCreateTemp()
Creates an empty temporary file and returns its full path.
The file is created in the system temporary directory, exists on return and is not removed automatically. Delete it with FileDelete when it is no longer needed.
Directory := FileDirName(Filename)
Returns the full path to Filename without the file name or trailing directory separator.
FullPath := FileFullPath(Filename)
Returns the full path to Filename.
#Import "Ks" { FileDirName, FileFullPath }
Full := FileFullPath("data\items.txt")
Parent := FileDirName(Full)
Writes to a temporary file and removes it afterwards.
#Import "Ks" { FileCreateTemp }
Temp := FileCreateTemp()
try
FileAppend "scratch data", Temp
finally
FileDelete Temp