Skip to content

Modern Fs File Create

Paul Squires edited this page Oct 22, 2026 · 3 revisions

Home › Filesystem › File Streams › File.Create

File.Create

Opens a file for writing, creating it or emptying it first.

Syntax

File.Create( p )

Notes

  • Write + Create + Truncate.

Examples

#import "std/fs"
using fs

dim as ustring dir_ = CreateTempDir( "tkdoc" ).Value( )
dim as ustring p = PathJoin( dir_, "f.txt" )
dim as File f
print f.Create( p ).IsOk( )    '' true
print f.CanWrite( ), f.CanRead( )    '' true false
f.Close( )

RemoveDirAll( dir_ )

Library: Filesystem Library Category: File Streams Documented under: Files

Clone this wiki locally