Directory = getdirectory ( ), Filelist = listfiles ( pattern ), Status = login ( hostname, username, password ) – Casio Naurtech CETerm Ver.5.5 Scripting Guide User Manual
Page 48

N
AURTECH
W
EB
B
ROWSER AND
T
ERMINAL
E
MULATION FOR
W
INDOWS
CE
AND
W
INDOWS
M
OBILE
CETerm Scripting Guide
Page 48
directory = GetDirectory ( )
Return the name of the current working directory on the host. Returns null on
failure. Use the FTP properties LastError and LastErrorText to get additional
error information.
filelist = ListFiles ( pattern )
Return a list of remote files with names that match a pattern. The pattern
specifies a valid directory path or file name on the remote host, which can
contain wildcard characters, such as an asterisk (*) or a question mark (?); but
may not contain spaces. An empty pattern will list all files in the current working
directory. The returned list is in the fo
rm of a JavaScript array literal [ …] which
contains JavaScript object literals {…} containing information about every
matching file. See Section 2.8 for details about handling JavaScript literals.
Return an empty array literal if no matching files are found. Use the FTP
properties LastError or LastErrorText to get additional error information.
The returned object literals will depend on the remote host and may not contain
all possible properties. See Section 2.8 for dealing with missing properties. For
example the following array literal shows two files and a directory:
[ {name:"myApp.cab", attributes:0x21,
creationTime:new Date(2006,11,15,11,51,41,480),
lastAccessTime:new Date(2007,7,27,3,27,41,0),
lastWriteTime:new Date(2008,6,15,0,29,50,0), size:2455494},
{name:"myconfig.ini", attributes:0x21,
lastAccessTime:new Date(2007,7,27,3,27,18,0),
lastWriteTime:new Date(2008,6,15,0,29,48,0), size:12564},
{name:"AppDirectory", attributes:0x10,
lastWriteTime:new Date(2008,2,11,12,29,49,0), size:1024} ]
Note that the “creationTime” and “lastAccessTime” are not always present and
should be checked for existence before using them. Their existence depends on
the type of remote host. See any standard JavaScript reference for details on
the Date() constructor arguments. See Appendix 4 for attribute definitions.
status = Login ( hostname, userName, password )
Establish an FTP connection to the remote named host. The userName and
password are used for authentication. If the default values are not correct, you
must configure the Port and PassiveMode properties before Login. Return 0 on