Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 4fccfe23f6486142b4197d1daac0cf21 > files > 13

Falcon-doc-0.9.6.6-2.fc15.noarch.rpm

<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <title>Class Directory - Class Directory</title>
   <link href="faldoc.css" rel="stylesheet" type="text/css"/>
   <link href="tabs.css" rel="stylesheet" type="text/css"/>
</head>
<body class="faldoc_body">
<div class="navitop">
   <div class="tabs">
      <ul>
         <li><a href="./index.html"><span>Main</span></a></li>
         <li><a href="./pages.html"><span>Related pages</span></a></li>
         <li><a href="./groups.html"><span>Groups</span></a></li>
         <li><a href="./funset.html"><span>Function sets</span></a></li>
         <li><a href="./classes.html"><span>Classes</span></a></li>
         <li><a href="./objects.html"><span>Objects</span></a></li>
         <li><a href="./functions.html"><span>All functions</span></a></li>
         <li><a href="./globals.html"><span>Globals</span></a></li>
         
      </ul>
   </div>
</div>
<hr/>

<h1 class="faldoc_title">Class Directory</h1>

<p class="faldoc_brief">Special iterator to access directory listings. </p>
<p class="faldoc_funcdecl">
<b>class</b> Directory( dirname )
</p>


   <p class="faldoc_brief"><a href="#more">more...</a></p>
   <h2 class="faldoc_title">Summary</h2>
   <table class="faldoc_list">
   
      
         <tr><td><a href="#close">close()</a></td><td>Closes the directory object. </td></tr>
      
         <tr><td><a href="#descend">descend()</a></td><td>Descends into subdirectories, iteratively calling a function. </td></tr>
      
         <tr><td><a href="#error">error()</a></td><td>Returns the last system error code that the directory operation causes. </td></tr>
      
         <tr><td><a href="#read">read()</a></td><td>Returns the next entry in the directory. </td></tr>
      
   
   </table>







<a name="more"><h2 class="faldoc_title">Detailed description</h2></a>

<p class="faldoc_funcdecl">
<b>class</b> Directory( dirname )
</p>
<table class="faldoc_function">
<tr><td class="faldoc_param">dirname</td><td class="faldoc_paramdesc">A relative or absolute path to a directory </td></tr>

</table>
<br/>
<p class="item_brief">Special iterator to access directory listings. </p>
<p class="faldoc_text">The Directory class allow to iterate through the contents of a local file directory. </p>
<p class="faldoc_text">The caller should repeatedly call the read() method until nil is returned. In case an error is raised, the error() method may be called to get informations on the cause that raised the error. </p>
<p class="faldoc_text">After the read is complete, the caller should call close() to free the resources associated with the object. The garbage collector will eventually take care of it, but it is better to close the object as soon as possible. </p>




   <h2 class="faldoc_title">Methods</h2>
   
      <h3 class="faldoc_funcname"><a name="close">close()</a></h3>
      <p class="item_brief">Closes the directory object. </p>
      <p class="faldoc_funcdecl">Directory.close( )</p>
      
      <p class="faldoc_text"><p class="faldoc_text">This method should be called when the item is not needed anymore to free system resources. </p>
<p class="faldoc_text">However, the directory listing is closed at garbage collecting. </p>
</p>
   
      <h3 class="faldoc_funcname"><a name="descend">descend()</a></h3>
      <p class="item_brief">Descends into subdirectories, iteratively calling a function. </p>
      <p class="faldoc_funcdecl">Directory.descend( [dfunc], [ffunc] )</p>
      
         <table class="faldoc_function">
         
         <tr><td class="faldoc_optparam">dfunc</td><td class="faldoc_optparamdesc">Function to be called upon directories. </td></tr><tr><td class="faldoc_optparam">ffunc</td><td class="faldoc_optparamdesc">Function to be called upon files. </td></tr>
         
         
         </table>
      
      <p class="faldoc_text"><p class="faldoc_text"> This function calls iteratively a function on directory entries. If an entry is detected to be a directory, it is passed to <b>dfunc</b> as the only parameter. If <b>ffunc</b> is also provided, then it will receive all the non-directory entries. Entries coresponding to the current directory and the parent directory will never be sent to the handler functions. </p>
<p class="faldoc_note"><span class="faldoc_notetype">Note:</span>  The parameters for <b>dfunc</b> and <b>ffunc</b> will always be relative to the directory on which this object has been created. </p>
<p class="faldoc_text"> Retunring an out of band 0, any of the callbacks involved may stop the processing and return immediately. An out of band 1 will skip the currently processed item and proceed. The <b>dfunc</b> handler is called before descending into the found subdirectory; this gives the handlers the chance to skip directories or interrupt the search. </p>
<p class="faldoc_note"><span class="faldoc_notetype">Note:</span> After a complete descend, this directory will be closed and won't be usable anymore. </p>
</p>
   
      <h3 class="faldoc_funcname"><a name="error">error()</a></h3>
      <p class="item_brief">Returns the last system error code that the directory operation causes. </p>
      <p class="faldoc_funcdecl">Directory.error( )</p>
      
         <table class="faldoc_function">
         
         
         <tr><td class="faldoc_funcreturn">Returns:</td><td class="faldoc_funcreturndesc">A system error code. </td></tr>
         
         </table>
      
      <p class="faldoc_text"><p class="faldoc_text"> The error code may be rendered into a string using the <a href="./functions.html#systemErrorDescription">systemErrorDescription</a> function. </p>
</p>
   
      <h3 class="faldoc_funcname"><a name="read">read()</a></h3>
      <p class="item_brief">Returns the next entry in the directory. </p>
      <p class="faldoc_funcdecl">Directory.read( )</p>
      
         <table class="faldoc_function">
         
         
         <tr><td class="faldoc_funcreturn">Returns:</td><td class="faldoc_funcreturndesc">A string representing the next entry, or nil when no new entries are left. </td></tr>
         
         </table>
      
      
   

<hr/>
<div class="navibottom">
   <center>
      <a href="./index.html">Main</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./pages.html">Related pages</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./groups.html">Groups</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./funset.html">Function sets</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./classes.html">Classes</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./objects.html">Objects</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./functions.html">All functions</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./globals.html">Globals</a>
   </center>
</div>
</div>
<div class="faldoc_signature">Made with <a href="http://www.falconpl.org">faldoc 2.2.0</div>
</body>
</html>