sniper Tue Mar 6 15:43:03 2001 EDT
Modified files:
/phpdoc/en/functions filesystem.xml
Log:
Added note about fread() on windows..
Index: phpdoc/en/functions/filesystem.xml
diff -u phpdoc/en/functions/filesystem.xml:1.52 phpdoc/en/functions/filesystem.xml:1.53
--- phpdoc/en/functions/filesystem.xml:1.52 Wed Jan 3 11:17:46 2001
+++ phpdoc/en/functions/filesystem.xml Tue Mar 6 15:43:03 2001
@@ -1134,12 +1134,16 @@
</simpara>
</listitem>
</itemizedlist>
- The <parameter>mode</parameter> may contain the letter
- 'b'. This is useful only on systems which differentiate between
- binary and text files (i.e., it's useless on Unix). If not
- needed, this will be ignored.
</para>
<para>
+ <note>
+ The <parameter>mode</parameter> may contain the letter
+ 'b'. This is useful only on systems which differentiate between
+ binary and text files (i.e. Windows. It's useless on Unix).
+ If not needed, this will be ignored.
+ </note>
+ </para>
+ <para>
You can use the optional third parameter and set it to "1", if
you want to search for the file in the <link
linkend="ini.include-path">include_path</link>, too.
@@ -1277,6 +1281,23 @@
// get contents of a file into a string
$filename = "/usr/local/something.txt";
$fd = fopen ($filename, "r");
+$contents = fread ($fd, filesize ($filename));
+fclose ($fd);
+ </programlisting>
+ </informalexample>
+ </para>
+ <para>
+ <note>
+ On systems which differentiate between binary and text files
+ (i.e. Windows) the file must be opened with 'b' included in
+ <function>fopen</function> mode parameter.
+ </note>
+ </para>
+ <para>
+ <informalexample>
+ <programlisting role="php">
+$filename = "c:\\files\\somepic.gif";
+$fd = fopen ($filename, "rb");
$contents = fread ($fd, filesize ($filename));
fclose ($fd);
</programlisting>