downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Our source is open

The syntax highlighted source is automatically generated by PHP from the plaintext script. If you're interested in what's behind the several functions we used, you can always take a look at the source of the following files:

Of course, if you want to see the source of this page, we have it available. You can also browse the SVN repository for this website on svn.php.net.

Source of: /manual/en/wrappers.file.php

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once
dirname(__FILE__) ."/toc/wrappers.inc";
$setup = array (
 
'home' =>
  array (
   
0 => 'index.php',
   
1 => 'PHP Manual',
  ),
 
'head' =>
  array (
   
0 => 'UTF-8',
   
1 => 'en',
  ),
 
'this' =>
  array (
   
0 => 'wrappers.file.php',
   
1 => 'Filesystem',
  ),
 
'up' =>
  array (
   
0 => 'wrappers.php',
   
1 => 'List of Supported Protocols/Wrappers',
  ),
 
'prev' =>
  array (
   
0 => 'wrappers.php',
   
1 => 'List of Supported Protocols/Wrappers',
  ),
 
'next' =>
  array (
   
0 => 'wrappers.http.php',
   
1 => 'HTTP and HTTPS',
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<div id="wrappers.file" class="section">
  <h2 class="title">Filesystem</h2>
  <p class="simpara">All versions of PHP. Explicitly using <var class="filename">file://</var> since PHP 5.0.0.</p>

  <ul class="itemizedlist">
   <li class="listitem"><span class="simpara"><var class="filename">/path/to/file.ext</var></span></li>
   <li class="listitem"><span class="simpara"><var class="filename">relative/path/to/file.ext</var></span></li>
   <li class="listitem"><span class="simpara"><var class="filename">fileInCwd.ext</var></span></li>
   <li class="listitem"><span class="simpara"><var class="filename">C:/path/to/winfile.ext</var></span></li>
   <li class="listitem"><span class="simpara"><var class="filename">C:\path\to\winfile.ext</var></span></li>
   <li class="listitem"><span class="simpara"><var class="filename">\\smbserver\share\path\to\winfile.ext</var></span></li>
   <li class="listitem"><span class="simpara"><var class="filename">file:///path/to/file.ext</var></span></li>
  </ul>

  <p class="simpara">
   <em class="emphasis">Filesystem</em> is the default wrapper used with PHP and represents the local filesystem.
   When a relative path is specified (a path which does not begin with /, \, \\, or a Windows drive letter)
   the path provided will be applied against the current working directory.  In many cases this is the
   directory in which the script resides unless it has been changed.  Using the CLI sapi, this defaults
   to the directory from which the script was called.
  </p>

  <p class="simpara">
   With some functions, such as <a href="function.fopen.php" class="function">fopen()</a> and <a href="function.file-get-contents.php" class="function">file_get_contents()</a>,
   <i>include_path</i> may be optionally searched for relative paths as well.
  </p>

  <p class="para">
   </p><table class="doctable table">
    <caption><b>Wrapper Summary</b></caption>
   
     <thead valign="middle">
      <tr valign="middle">
       <th>Attribute</th>
       <th>Supported</th>
      </tr>

     </thead>

     <tbody valign="middle" class="tbody">
      <tr valign="middle">
       <td align="left">Restricted by <a href="filesystem.configuration.php#ini.allow-url-fopen" class="link">allow_url_fopen</a></td>
       <td align="left">No</td>
      </tr>

      <tr valign="middle">
       <td align="left">Allows Reading</td>
       <td align="left">Yes</td>
      </tr>

      <tr valign="middle">
       <td align="left">Allows Writing</td>
       <td align="left">Yes</td>
      </tr>

      <tr valign="middle">
       <td align="left">Allows Appending</td>
       <td align="left">Yes</td>
      </tr>

      <tr valign="middle">
       <td align="left">Allows Simultaneous Reading and Writing</td>
       <td align="left">Yes</td>
      </tr>

      <tr valign="middle">
       <td align="left">Supports <a href="function.stat.php" class="function">stat()</a></td>
       <td align="left">Yes</td>
      </tr>

      <tr valign="middle">
       <td align="left">Supports <a href="function.unlink.php" class="function">unlink()</a></td>
       <td align="left">Yes</td>
      </tr>

      <tr valign="middle">
       <td align="left">Supports <a href="function.rename.php" class="function">rename()</a></td>
       <td align="left">Yes</td>
      </tr>

      <tr valign="middle">
       <td align="left">Supports <a href="function.mkdir.php" class="function">mkdir()</a></td>
       <td align="left">Yes</td>
      </tr>

      <tr valign="middle">
       <td align="left">Supports <a href="function.rmdir.php" class="function">rmdir()</a></td>
       <td align="left">Yes</td>
      </tr>

     </tbody>
   
   </table>
<p>
  </p>
 </div><?php manual_footer(); ?>
 
show source | credits | sitemap | contact | advertising | mirror sites