### 4.1.3 Reading files

Information for Xcas can be stored in a file; this information can be read with the read command, depending on the type of information.

The read command reads a file containing Xcas information, such as a program that you saved (see Section 2.6.3) or simply commands that you typed into a file with a text editor. The file should have the suffix .cxx.

- read takes filename, the name of a file (a string) containing a saved program (see Section 2.6.3) or other commands.
- read(filename) reads the content of the file.

#### Examples

If you have a file named myfunction.cxx,

read("myfunction.cxx")

will read in the file, as long as the directory is in the current working directory. If the file is in a different directory, you can still read it by giving the path to the file:

read("/path/to/file/myfunction.cxx")

In Windows, you should use \\ instead of / as the directory separator. In Linux, absolute paths usually begin with /home/.