Skip to content

Modern Fs CreateTempFile

Paul Squires edited this page Oct 19, 2026 · 6 revisions

Home › Filesystem › Filesystem Library › CreateTempFile

CreateTempFile

Creates a uniquely named temporary file and returns its path; it is not deleted for you.

Syntax

CreateTempFile( [ prefix ] )

Notes

  • CREATES it and returns the path
  • prefix defaults to "tiko".

Examples

#import "std/fs"
using fs

dim r as FsResultUStr = CreateTempFile( "fbdoc" )
dim as ustring p = r.Value( )

print r.IsOk( )              '' true
print IsFile( p )            '' true -- it exists, empty, already created

WriteAllText( p, "hello" )
print ReadAllText( p ).Value( )          '' hello

'' Created atomically, and NOT deleted automatically
RemoveFile( p )

Library: Filesystem Library
Category: Filesystem
Documented under: File Operations

Clone this wiki locally