<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Parrot - File PMC</title> <link rel="stylesheet" type="text/css" href="../../../resources/parrot.css" media="all"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <div id="wrapper"> <div id="header"> <a href="http://www.parrot.org"> <img border=0 src="../../../resources/parrot_logo.png" id="logo" alt="parrot"> </a> </div> <!-- "header" --> <div id="divider"></div> <div id="mainbody"> <div id="breadcrumb"> <a href="../../../html/index.html">Home</a> » <a href="../../../html/pmc.html">PMCs</a> » File PMC </div> <h1><a name="NAME" >NAME</a></h1> <p>src/pmc/file.pmc - File PMC</p> <h1><a name="DESCRIPTION" >DESCRIPTION</a></h1> <p><code>File</code> is a singleton class which provides access to File functions.</p> <h2><a name="Methods" >Methods</a></h2> <dl> <dt><a name="void_*get_pointer()" ><b><code>void *get_pointer()</b></code></a></dt> <dt><a name="void_set_pointer(void_*ptr)" ><b><code>void set_pointer(void *ptr)</b></code></a></dt> These two functions are part of the singleton creation interface. For more information see <em>src/pmc.c</em>. <dt><a name="INTVAL_exists(STRING_*file)" ><b><code>INTVAL exists(STRING *file)</b></code></a></dt> Returns a true value (1) if the supplied file or directory exists. <dt><a name="INTVAL_is_dir(STRING_*path)" ><b><code>INTVAL is_dir(STRING *path)</b></code></a></dt> Returns a true value (1) if the supplied path is a directory. <dt><a name="INTVAL_is_file(STRING_*path)" ><b><code>INTVAL is_file(STRING *path)</b></code></a></dt> Returns a true value (1) if the supplied path is a plain file. <dt><a name="INTVAL_is_link(STRING_*path)" ><b><code>INTVAL is_link(STRING *path)</b></code></a></dt> Returns a true value (1) if the supplied path is a link. <dt><a name="void_copy(STRING_*from,_STRING_*to)" ><b><code>void copy(STRING *from, STRING *to)</b></code></a></dt> Copy the contents from file represented by path <code>from</code> to the path <code>to</code>.Uses the "work everywhere method". It is good enough to start with.NOTE: I'm sure that there should be more efficient ways to do this. Be free to change or give me hints on how to change it. -- ambs <dt><a name="void_rename(STRING_*from,_STRING_*to)" ><b><code>void rename(STRING *from, STRING *to)</b></code></a></dt> Rename a file <code>from</code> to the path <code>to</code>.</dl> <h1><a name="SEE_ALSO" >SEE ALSO</a></h1> <pre> stat(2), rename(2)</pre> </div> <!-- "mainbody" --> <div id="divider"></div> <div id="footer"> Copyright © 2002-2011, Parrot Foundation. </div> </div> <!-- "wrapper" --> </body> </html>