File system
____________________________

Special file names:

"COM1:[speed]" -
  Serial port 1

"COM2:[speed]" - 
  Serial port 2
  PalmOS has no COM2

The same for COM3..COM9

"PDOC:filename"
  Compressed PDOC files for
  PalmOS or PDB/PDOC files
  files on other systems.
  PDOCFS opens and
  uncompress the file on
  OPEN; and compress the
  file on CLOSE. So, it
  will use a lot of memory
  and time (its depended
  on size of the data).

"MEMO:memo-title"
  MemoDB of PalmOS or 
  regular file on other
  systems.
  Memo records (virtual
  files) are limited to 3935
  bytes

"SOCL:server:port"
  Socket client.
  Its not tested on PalmOS
  Its not exists for DOS

Example:

OPEN "COM1:" AS #1

OPEN "COM2:38400" AS #2

____________________________

FREEFILE

Returns an unused file
handle
____________________________

OPEN "file" [FOR {INPUT|
             OUTPUT|APPEND}]
             AS #fileN

Opens a file or device
____________________________

CLOSE #fileN

Close a file handle
____________________________

LOADLN "file", array

Loads a text file into array
variable.
Each text-line is an array
element.
____________________________

SAVELN "file", array

Writes an array to a text
file.
Each array element is a
text-line.
____________________________

EXIST(fileName)

Returns true if the fileName
exists
____________________________

EOF(fileN)

Returns true if the file
pointer is at end of the
file.

For COMx and SOCL VFS it
returns true if the
connection is broken.
____________________________

PRINT #fileN{,|;} var1
                     [,varN]

Write string to a file
____________________________

LINEINPUT #fileN{,|;} var$

Reads a whole text line from
file
____________________________

INPUT$(len[,fileN])

Reads 'len' bytes from file
or console (if fileN is 
omitted).
____________________________

INPUT #fileN{,|;} var1 [,
  var2 [, ...]]

Reads data from file
____________________________

SEEK #fileN{,|;} pos

Sets file position for
the next read/write
____________________________

SEEK(fileN)

Returns the current file
position
____________________________

LOF(fileN)

Returns the length of file
in bytes

For devices; returns the
number of available data
____________________________

KILL "file"

Deletes the specified file
____________________________

WRITE #fileN; var1 [, ...]
READ #fileN; var1 [, ...]

The READ/WRITE command set
is used to store variables
to a file as binary data.

The common problem with
INPUT/PRINT set is there
are many conficts with
datas. 

Example:
PRINT #1; "Hello, world"
You have wrote only
one string and you want
read it in one variable,
but this is impossible
for INPUT command to
understand it, because
INPUT finds the separator
comma, so it thinks there
are two variables not one

So, now, you can store
arrays, strings etc and what
is you write is what you
will read the next time.

BTW its faster too.

Notes:
The parameters can be
variables ONLY.

Its very bad idea to mixed
READ/WRITE commands with
INPUT/PRINT commands in
the same file.
____________________________

COPY "file", "newfile"

Makes a copy of specified 
file to the 'newfile'
____________________________

RENAME "file", "newfile"

Renames the specified file
____________________________

MKDIR dir$
CHDIR dir$
RMDIR dir$

Notes:
Non-PalmOS only.
____________________________

FILES(wildcards)

Returns an array with the
filenames.

If there is no files
returns an empty array
(1 element, with value "")

PalmOS:
For PalmOS returns only
the user-files.

Example:

? FILES("*")

Note: 
To use file on MEMO or 
PDOC or any other virtual
file system you must use
FILES("VFSx:*")

Example:
? FILES("MEMO:*")

