title: Attributes common to Internal File objects
author: Armin rigo

All Internal File Objects have the following additionnal attributes.

<table border=1 cellspacing=0 cellpadding=4>

<tr><td class="doccode">
filename
</td><td>
Name of the file, if this object has been loaded directly from a file or if it will be stored in a file. Should include the full path.
</td></tr>

<tr><td class="doccode">
tempfilename
</td><td>
Name of a temporary file where this data can be saved (for Auto-Save). The file name is based on the pointer address of the object: multiple reads of <tt>tempfilename</tt> will return the same value, and different objects will never have the same <tt>tempfilename</tt>.
</td></tr>

<tr><td class="doccode">
savefile()<br>
savefile(path)<br>
savefile(path,astext)
</td><td>
Saves the file. If no argument is given, <tt>filename</tt> must be set before. If <tt>path</tt> is specified, saves a copy of the file into <tt>path</tt> (which should be a full path and file name). If <tt>astext</tt> is specified, it overrides the current file format and specifies whether the file must be saved in full-text or binary format.
</td></tr>

<tr><td class="doccode">
conversion()<br>
conversion(type)
</td><td>
Conversion between different object types. Mostly used for conversions between textures and images. With no argument, returns a list of all types this object can be converted to, including the current type (each one is a string giving the extension of the corresponding files with the dot); with a type argument, it attemps to convert the object to the given type.
</td></tr>

</table>

Subclasses of Internal File Objects dont have more attributes. Most information is stored as Specifics-Args pairs and in
subitems. Three exceptions:

<ol>
<li>.BSP file objects have a few attributes required to load them in the map editor.
    See <tt>mapeditor.py</tt> for more information.
<li>.PAK and .PAKFOLDER file objects have a method <tt>extract</tt>, which extracts all files and
    subfolders into the directory given as parameter, which is created if required, as well as a method
    <tt>getfolder</tt> that creates a given path inside the .PAK file and returns the resulting
    .PAKFOLDER object.
<li>Textures have an attribute <tt>disktexture</tt> that loads and returns an actual texture object if the
    first texture were just a link.
</ol>
