Class IO.File

implements IO.Path

Represents a file in the filesystem

Constructors

File(string path)

Properties

name the file or folder name portion of the path as a string
path the path as a string

Methods

bytes() reads the entire contents of the file into a buffer
exists() returns true if the file or folder exists in the filesystem
folder() returns true if the path is a folder
len() the size of the file
reader()
remove()
text() reads the entire contents of the file into a string
writer()

Constructor Documentation


File(string path)

Parameters

Property Documentation


string name

The file or folder name portion of the path as a string.


string path

The path as a string.

Method Documentation


buffer bytes()

Reads the entire contents of the file into a buffer

Returns


bool exists()

Returns true if the file or folder exists in the filesystem.

Returns


bool folder()

Returns true if the path is a folder.

Returns


integer len()

The size of the file

Returns


reader reader()

Returns


bool remove()

Returns


string text()

Reads the entire contents of the file into a string

Returns


writer writer()

Returns



Creative Commons Logo This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.