file(fn:cs,hs)

Read(528) Label: remote file, sequence of nodes,

Description:

Return a remote file from a sequence of nodes.

Syntax:

file( fn:cs,hs)

Note:

The function searches the local machine for remote file fn from a sequence of nodes hs; it searches the nodes in turn if it cannot find the targe file locally. The returned file is read-only.

Parameter:

fn

To-be-loaded file represented by an absolute path or a relative path that is relative to the main directory

cs

Character set, which is a JVM built-in one; use the system default when the parameter is absent

hs

A sequence of nodes

Return value:

A file object

Example:

 

A

 

1

=file("City.txt":"UTF-8",["192.168.46.1:8281","192.168.31.165:8281"])

Find City.txt file under the main directory in the sequence of nodes ["192.168.46.1:8281","192.168.31.165:8281"] using character set UTF-8.

2

=A1.read()

Read in content of A1’s file.