This is a simple example of writing to and reading from a text file: fricas (1) -> f1: TextFile := open("/tmp/test",
Type: TextFile?
fricas writeLine!(f1,
Type: String
fricas close! f1
Type: TextFile?
fricas f2: TextFile := open("/tmp/test",
Type: TextFile?
fricas l := readLine! f2
Type: String
fricas output l Type: Void
fricas close! f2
Type: TextFile?
Here is a system command. It display how many files there are in the default current directory where Axiom is run. fricas )set output algebra on Type: Void
Please do not try to list the complete contents of this directory! If you do, MathAction will appear to hang. Here is a shorter list of files that works ok: fricas )set output algebra on Type: Void
fricas f2: TextFile := open("/tmp/test",
Type: TextFile?
fricas while not endOfFile? f2 repeat s := readLine! f2 output s Type: Void
fricas close! f2
Type: TextFile?
Here is an example of how to call a polymake constructor. Notice that you must use the full path name. fricas )set output algebra on Type: Void
Here is the standard output of the command (if any): fricas systemCommand("system cat /tmp/cube4.stdout") Type: Void
Here is the error output of the command (if any): fricas systemCommand("system cat /tmp/cube4.stderr") Type: Void
Now display the contents of the file that was created: fricas f2: TextFile := open("/tmp/cube4.poly", ... --kratt6, Fri, 26 Aug 2005 16:55:21 -0500 reply fricas systemCommand("system /usr/local/polymake/bin/cross /tmp/c4.poly 4") Type: Void
fricas systemCommand("system cat /tmp/c4.poly") Type: Void
|