<?xml version="1.0" encoding="utf-8" ?> <!-- for emacs: -*- coding: utf-8 -*- --> <!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head><title>how Macaulay2 finds its files</title> <link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/> </head> <body> <table class="buttons"> <tr> <td><div><a href="_current__Layout.html">next</a> | <a href="_replacements_spfor_spcommands_spand_spscripts_spfrom_sp__Macaulay.html">previous</a> | <a href="___Type.html">forward</a> | <a href="_replacements_spfor_spcommands_spand_spscripts_spfrom_sp__Macaulay.html">backward</a> | <a href="index.html">up</a> | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div> </td> </tr> </table> <div><a href="index.html" title="">Macaulay2Doc</a> > <a href="_how_sp__Macaulay2_spfinds_spits_spfiles.html" title="">how Macaulay2 finds its files</a></div> <hr/> <div><h1>how Macaulay2 finds its files</h1> <div>When you run Macaulay2, it has to find and load a sequence of startup files containing code written in the Macaulay2 language, or it has to find a data file containing a memory dump from a previous session. Here is the way it does that.<p/> Its first task is to discover the path to the binary file <tt>M2</tt> that is currently running. On some systems, that information is available from the <tt>/proc</tt> file system. Otherwise, it examines the command name you used to run the program, which is provided to it as the argument in position number 0 on the command line. If it's not an absolute path, it searches along the path of directories mentioned in the environment variable PATH until it finds a file with the same name. If the result is a symbolic link, the link is followed. The final result is assumed to be in a directory named "<tt>bin/</tt>", and the startup files are located relative to that. The path to the top level directory is stored in the variable <a href="_prefix__Directory.html" title="the prefix directory">prefixDirectory</a>, which you can examine to see whether it all worked out. For detailed information about the relative location of Macaulay2 files, see <a href="_current__Layout.html" title="relative locations of Macaulay2 files">Layout</a>.<p/> A possible data memory dump file may be located in the directory <tt>lib/Macaulay2/i686-Linux-Fedora-15/Core/cache/</tt> and loaded with <a href="_loaddata.html" title="load state of the system from a file">loaddata</a>. If the file is present and and loading it works, then startup will be quicker. If it's absent then the necessary setup files will be loaded instead; if problems with it are encountered, it is always safe to delete it. The name of the file data dump file is of the form "Macaulay2-*-data", where "*" is replaced by the value of the environment variable name M2ARCH if present, or else is a value computed at compile time and stored in the hash table called <a href="_version.html" title="information about this version of the program">version</a> and accessible as <tt>version#"architecture"</tt>.</div> <div><h3>Menu</h3> <ul><li><span>Layout, see <span><a href="_current__Layout.html" title="relative locations of Macaulay2 files">currentLayout</a> -- relative locations of Macaulay2 files</span></span></li> <li><span><a href="_prefix__Directory.html" title="the prefix directory">prefixDirectory</a> -- the prefix directory</span></li> </ul> </div> </div> </body> </html>