Printer FriendlyEmail Article Link

Abacus: Does ::aba::ReadFromFile provide a error message when the system is unable to execute the command?

Environment/Versions

Users are using Tcl automation to run Abacus tests. During the test run, users need to save and extract data from data files using the abacus tcl API utilities.  They would like to know if error occurs, how would this be reported.

Answer

The command ::aba::ReadFromFile" is not a "real" abacus Tcl API.  It is a simple utilities using native Tcl commands to do the job.  The purspose is to save user from using the tedious file manipulation commands with Tcl. As such, there is no real return values from Abacus at all.   We count on the native tcl and window OS to report if there is any abnormalities encountered when running this command.

So if users are trying to read data from a file not existing, they will get the response from the tcl-window OS platform as shown below.

-----------------------------------------------------------------------------------------------------------------

% package require tdom
0.8.3
% package require Itcl
3.4
% lappend auto_path c:/tcl/apiclasses
C:/Tcl/lib/tcl8.4 C:/Tcl/lib c:/tcl/lib/teapot/package/win32-ix86/lib c:/tcl/lib
/teapot/package/tcl/lib C:/Tcl/lib/tcllib1.10 C:/Tcl/lib/tklib0.4 c:/tcl/apiclas
ses
% package require tclreadyapi
1
% ::aba::WriteToFile c:/testOn.txt "I am testing."
% ::aba::ReadFromFile c:/testOn.txt
I am testing.

% ::aba::ReadFromFile c:/testOn1.txt
couldn't open "c:/testOn1.txt": no such file or directory
%

--------------------------------------------------------------------------------------------


Product : Abacus,Automation,6.11 and below