Name:

readfile reads the content of a file into a string variable

Usage:

readfile(filename) : string -> string

Parameters:

Description:

Example 1:

   > print("Hello world") > "myfile.txt";
   > t = readfile("myfile.txt");
   > t;
   Hello world
   

Example 2:

   > verbosity=1!;
   > readfile("afile.txt");
   Warning: the file "afile.txt" could not be opened for reading.
   Warning: at least one of the given expressions or a subexpression is not correctly typed
   or its evaluation has failed because of some error on a side-effect.
   error
See also: parse, execute, write, print, bashexecute, error
Go back to the list of commands