Skip to content

Modern Fs AppendAllBytes

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

Home › Filesystem › File Streams › AppendAllBytes

AppendAllBytes

Adds an Array of bytes to the end of a file, creating the file if it is not there.

Syntax

AppendAllBytes( p, buf )

Notes

  • Appends buf, an Array( of ubyte ), creating p if needed. Each write lands at the end, atomically per write.

Examples

#import "std/fs"
#import "std/containers"
using fs

dim as ustring dir_ = CreateTempDir( "tkdoc" ).Value( )
dim as ustring p = PathJoin( dir_, "f.txt" )
dim as containers.Array( of ubyte ) b
b.Push( 65 ) : b.Push( 66 )
AppendAllBytes( p, b )
AppendAllBytes( p, b )
print ReadAllText( p ).Value( )    '' ABAB
RemoveDirAll( dir_ )

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

Clone this wiki locally