APLX Native File Support
APLX provides a full set of system functions which let you access the native file system on your host machine.
In many cases, the easiest way to read or write data in files is to use the
Native file functions using tie numbers
Most of the APLX native file functions refer to a host file through a file tie number, a non-zero integer value used to identify the file once it has been opened. You can specify the tie number yourself as an argument to the
Files may be accessed totally randomly, that is you can read and write data as an arbitrary stream of bytes anywhere in the file. The
When you have finished using a file it must be untied using the
Errors may arise using the native file system for a number of reasons, for example an attempt to tie a non-existent file or to read beyond the end of a file. In the event of an error of this type, the system function will return a FILE I/O ERROR. In addition, if error trapping is not enabled, a short informative message is displayed:
'TEST.DATA' ⎕NTIE 1 A file or directory in the path name does not exist. FILE I/O ERROR 'TEST.DATA' ⎕NTIE 1 ^
The text of the specific error message is also available using the
File size limits
In 32-bit versions of APLX, the maximum integer is 2147483647. Because file sizes and positions are expressed as integers, this effectively puts a limit of 2GB on the size of native files which you can directly access in the 32-bit versions of APLX.
In APLX64, the maximum integer is 9223372036854775807, making it possible to directly access files of up to 8,589,934,592 GB.
Special considerations for Client-Server versions of APLX
In Client-Server implementations of APLX, you can specify whether the native file access should take place on the Client or Server machine. See the description of
Copyright © 1996-2010 MicroAPL Ltd