Topic: APLX Help : Help on APL language : System Functions & Variables : ⎕NTIE Open native file
[ Previous | Next | Contents | Index | APL Home ]

www.microapl.co.uk

⎕NTIE Open an existing file and associate it with a tie number


This function is used to open an existing file and associate it with the supplied tie number, or with a tie number allocated by APLX. You must have the correct host access permission to open the file in the specified mode.

The syntax of ⎕NTIE is ({} means optional) :

          'FILENAME' ⎕NTIE TIENO {,MODE}

'FILENAME' is a character vector specifying the name of the file to tie. The name may be either a full host path name, or the path may be omitted in which case the file to tie must be located in the current working directory.

TIENO is an arbitrary non-zero integer to be used in subsequent read/write operations to identify the file. It can be positive or negative. It must not currently be in use to tie another file.

Alternatively, TIENO can be zero. In this case, APLX allocates the next available free tie number and returns it as the explicit result of the function. (The value returned is equivalent to the expression 1+⌈/0,⎕NNUMS before the function is tied).

The optional MODE parameter indicates the access mode as follows : 0=read only, 1=write only, 2=read/write (default).

MacOS Resource Forks

Under APLX for MacOS prior to APLX Version 3.5, ⎕NTIE can optionally take a third argument indicating the file 'fork' to open. If this parameter is omitted or is 0, the data fork is opened. If this parameter is 1, the resource fork is opened.

Because Apple are phasing out the use of resource forks in MacOS X, this facility has had to be withdrawn from APLX Version 3.5 onwards.

Special considerations for Client-Server implementations of APLX

In Client-Server implementations of APLX, the front-end which implements the user-interface (the "Client") runs on one machine, and the APLX interpreter itself (the "Server") can run on a different machine.

In such systems, you can specify whether the file being accessed is located on the Client or the Server machine. You do this by preceding the path name with either an Up Arrow to indicate that the file is on the Client, or a Down Arrow to indicate that it is on the Server. (If you do not specify, the default is that the access takes place on the Client.)


Topic: APLX Help : Help on APL language : System Functions & Variables : ⎕NTIE Open native file
[ Previous | Next | Contents | Index | APL Home ]