The Fabl Manual
Function Index
Class Index
Globals Index
Libraries
Contents

Title Page
Introduction
Sample Code
Architecture
Syntax
Strong Typing
Polymorphism
Operators
Help
Errors
Configuration
RDF
Namespaces
Owl
Datatypes
Resources
Dot ops
Coercion
Type Casting
nil

Types
string
id
int
double
boolean
Literal
Containers
Functions
void

Home
Regarding
The Path
Classes
Delegation
Functional Values
Read/Write
Load/Store
Libraries
Imports
CGI
Read/Write

The function

void function write(<anyType> a0,<anyType> a1, ... <anyType> an);

writes the arguments a0...an

void function writeln(<anyType> a0,<anyType> a1, ... <anyType> an);

is identical, except that it appends a linefeed. Example:

{writeln('x = ',2+3);writeln("abc");}
-->x = 5
-->abc

The function

boolean fwrite(string url,string s)

writes the string s out to the file at url. It returns true if the write succeeded.

In Fabl, URLs are used to denote files, whether present on the local filesystem or not. So, for example,

file:///usr/local/fabl-2.0.11/bin/init.fbl

denotes the file at /usr/local/fabl-2.0.11/bin/init.fbl on the local system. As a convenience, the prefix "file://" will be added in most contexts where a URL is expected if the URL supplied lacks a scheme.

The function

string fread(string url)

returns the contents of url, or nil if there was an error in the attempted read.

The variant

boolean fread(string dst,string url)

appends the contents of the file at url onto dst. It returns true if the read was successful.