User guide

7 RASExpress Script Language
CommPlete Communications Server 171
FWRITE fwrite(integer file_handle, string buffer, integer count) : integer;
Writes count bytes from buffer to the file specified by file_handle. The number of bytes
written is returned as the value of the function.
Example
See fcreate command.
GETFILEATTR getfileattr(string file_name) : integer;
Gets the attribute of the file specified by file_name if the file is present; otherwise -1 is
returned. The attribute value is as returned by the DOS Int 21 Fn 4300h call.
Example
See getfiledate command.
GETFILEDATE getfiledate(string file_name, var string buffer) : integer;
Gets the date on the file specified by file_name if present, and copies it to buffer (in
mm:dd:yy format). If the file is present, 1 is returned, else 0 is returned.
Example
/* This script illustrates the getfiledate, getfiletime, */
/* getfileattr, setfiledate, setfiletime, and setfileattr */
/* commands. */
proc main;
string buffer;
string file_name;
string date;
string time;
integer attribute;
integer len;
integer size;
len = 45;
display("Example for getfiledate, getfiletime, getfileattr,^J^M");
display("setfiledate, setfiletime, and setfileattr commands^J^M");
display("Enter file name : ");
if getstr(file_name, len) then
if getfiledate(file_name, date) then
fdisplay("^J^MFile date is : %s^J^M", date);
else
display("^J^MError getting file date^J^M");
endif
if getfiletime(file_name, time) then
fdisplay("File time is : %s^J^M", time);
else
display("Error getting file time^J^M");
endif
size = getfilesize(file_name);
if size != -1 then
fdisplay("File size is : %d^J^M", size);
else
display("Error getting file size^J^M");
endif
attribute = getfileattr(file_name);
if attribute != -1 then
fdisplay("Attribute is : %d^J^M", attribute);
else