Skip to content

Modern Fs File OpenAppend

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

Home › Filesystem › File Streams › File.OpenAppend

File.OpenAppend

Opens a file so every write goes to its end, creating it if needed.

Syntax

File.OpenAppend( p )

Notes

  • Append + Create: every write goes to the end, whatever the position.

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
f.OpenAppend( p )
f.WriteUtf8( "a" )
f.Seek( 0 )
f.WriteUtf8( "b" )
f.Close( )
print ReadAllText( p ).Value( )    '' ab

RemoveDirAll( dir_ )

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

Clone this wiki locally