Skip to content

Modern Fs File OpenRead

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

Home › Filesystem › File Streams › File.OpenRead

File.OpenRead

Opens an existing file for reading only.

Syntax

File.OpenRead( p )

Notes

  • Read only; the file must exist (FS_NOT_FOUND otherwise).

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 cbool( f.OpenRead( p ).Failure( ).Code( ) = FS_NOT_FOUND )    '' true

RemoveDirAll( dir_ )

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

Clone this wiki locally