From dc12b3bc553a0b4c33c66c045f914a8ea94a61b9 Mon Sep 17 00:00:00 2001 From: Mehdi Achour Date: Sat, 16 Aug 2003 21:42:13 +0000 Subject: [PATCH] adding examples proposed by vincent at php dot net most of them are from users notes git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@138029 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/filesystem/functions/fileatime.xml | 21 +++++++- reference/filesystem/functions/filectime.xml | 23 ++++++++- reference/filesystem/functions/filesize.xml | 19 ++++++- reference/filesystem/functions/filetype.xml | 19 ++++++- reference/filesystem/functions/flock.xml | 25 +++++++++- reference/filesystem/functions/fpassthru.xml | 26 +++++++++- reference/filesystem/functions/fseek.xml | 28 +++++++++-- reference/filesystem/functions/fstat.xml | 49 ++++++++++++++++++- reference/filesystem/functions/ftell.xml | 23 ++++++++- .../filesystem/functions/is-executable.xml | 22 ++++++++- reference/filesystem/functions/link.xml | 4 +- reference/filesystem/functions/linkinfo.xml | 16 +++++- reference/filesystem/functions/readlink.xml | 17 ++++++- 13 files changed, 274 insertions(+), 18 deletions(-) diff --git a/reference/filesystem/functions/fileatime.xml b/reference/filesystem/functions/fileatime.xml index 61f909753b..6b39414ff0 100644 --- a/reference/filesystem/functions/fileatime.xml +++ b/reference/filesystem/functions/fileatime.xml @@ -1,5 +1,5 @@ - + @@ -31,6 +31,25 @@ ¬e.no-remote; + + + <function>fileatime</function> example + + +]]> + + + See also filemtime, fileinode, and diff --git a/reference/filesystem/functions/filectime.xml b/reference/filesystem/functions/filectime.xml index de4bc17170..17cf3e1641 100644 --- a/reference/filesystem/functions/filectime.xml +++ b/reference/filesystem/functions/filectime.xml @@ -1,5 +1,5 @@ - + @@ -33,7 +33,26 @@ ¬e.clearstatcache; ¬e.no-remote; - + + + + <function>fileatime</function> example + + +]]> + + + See also filemtime diff --git a/reference/filesystem/functions/filesize.xml b/reference/filesystem/functions/filesize.xml index 33b77f0276..ef8f066da4 100644 --- a/reference/filesystem/functions/filesize.xml +++ b/reference/filesystem/functions/filesize.xml @@ -1,5 +1,5 @@ - + @@ -28,6 +28,23 @@ ¬e.no-remote; + + + <function>filesize</function> example + + +]]> + + + See also file_exists diff --git a/reference/filesystem/functions/filetype.xml b/reference/filesystem/functions/filetype.xml index 5d678de4b0..5051ce2bdd 100644 --- a/reference/filesystem/functions/filetype.xml +++ b/reference/filesystem/functions/filetype.xml @@ -1,5 +1,5 @@ - + @@ -26,8 +26,23 @@ ¬e.no-remote; + + + <function>filetype</function> example + + +]]> + + + - See also: is_dir, is_file, + See also is_dir, is_file, is_link, file_exists, stat, and mime_content_type. diff --git a/reference/filesystem/functions/flock.xml b/reference/filesystem/functions/flock.xml index 5f3ec2dbee..7def091c3c 100644 --- a/reference/filesystem/functions/flock.xml +++ b/reference/filesystem/functions/flock.xml @@ -1,5 +1,5 @@ - + @@ -67,6 +67,29 @@ &return.success; + + + <function>flock</function> example + + +]]> + + + Because flock requires a file pointer, you may have diff --git a/reference/filesystem/functions/fpassthru.xml b/reference/filesystem/functions/fpassthru.xml index d8b3eb5259..82db7077f3 100644 --- a/reference/filesystem/functions/fpassthru.xml +++ b/reference/filesystem/functions/fpassthru.xml @@ -1,5 +1,5 @@ - + @@ -50,6 +50,30 @@ your scripts will be more portable. + + + Using <function>fpassthru</function> with binary files + + +]]> + + + See also readfile, fopen, popen, and diff --git a/reference/filesystem/functions/fseek.xml b/reference/filesystem/functions/fseek.xml index 402fff4a33..dbc9f32feb 100644 --- a/reference/filesystem/functions/fseek.xml +++ b/reference/filesystem/functions/fseek.xml @@ -1,5 +1,5 @@ - + @@ -29,13 +29,35 @@ value in offset.) - If whence is not specified, it is assumed to be - SEEK_SET. + + If whence is not specified, it is assumed to be + SEEK_SET. Upon success, returns 0; otherwise, returns -1. Note that seeking past EOF is not considered an error. + + + <function>fseek</function> example + + +]]> + + + May not be used on file pointers returned by fopen if they use the "http://" or "ftp://" diff --git a/reference/filesystem/functions/fstat.xml b/reference/filesystem/functions/fstat.xml index a2add81a7d..8f8b7eaa51 100644 --- a/reference/filesystem/functions/fstat.xml +++ b/reference/filesystem/functions/fstat.xml @@ -1,5 +1,5 @@ - + @@ -22,6 +22,53 @@ Returns an array with the statistics of the file; the format of the array is described in detail on the stat manual page. + + + <function>fstat</function> example + + +]]> + + + this will output : + + + 771 + [ino] => 488704 + [mode] => 33188 + [nlink] => 1 + [uid] => 0 + [gid] => 0 + [rdev] => 0 + [size] => 1114 + [atime] => 1061067181 + [mtime] => 1056136526 + [ctime] => 1056136526 + [blksize] => 4096 + [blocks] => 8 +) +]]> + + + ¬e.clearstatcache; diff --git a/reference/filesystem/functions/ftell.xml b/reference/filesystem/functions/ftell.xml index 8c72dbe2a8..0b1b701076 100644 --- a/reference/filesystem/functions/ftell.xml +++ b/reference/filesystem/functions/ftell.xml @@ -1,5 +1,5 @@ - + @@ -25,6 +25,27 @@ successfully opened by fopen or popen. + + + <function>ftell</function> example + + +]]> + + + See also fopen, popen, fseek, and rewind. diff --git a/reference/filesystem/functions/is-executable.xml b/reference/filesystem/functions/is-executable.xml index 79d7e435ba..689b547076 100644 --- a/reference/filesystem/functions/is-executable.xml +++ b/reference/filesystem/functions/is-executable.xml @@ -1,5 +1,5 @@ - + @@ -19,6 +19,26 @@ is_executable became available with Windows in PHP version 5.0.0. + + + <function>is_executable</function> example + + +]]> + + + ¬e.clearstatcache; diff --git a/reference/filesystem/functions/link.xml b/reference/filesystem/functions/link.xml index ea7fbaa205..dac1f64a4c 100644 --- a/reference/filesystem/functions/link.xml +++ b/reference/filesystem/functions/link.xml @@ -1,5 +1,5 @@ - + @@ -14,7 +14,7 @@ stringlink - link creates a hard link. + link creates a hard link. &return.success; ¬e.no-remote; diff --git a/reference/filesystem/functions/linkinfo.xml b/reference/filesystem/functions/linkinfo.xml index f8d69a6e0a..ab690885cf 100644 --- a/reference/filesystem/functions/linkinfo.xml +++ b/reference/filesystem/functions/linkinfo.xml @@ -1,5 +1,5 @@ - + @@ -20,6 +20,20 @@ as the S_ISLNK macro defined in stat.h). Returns 0 or &false; in case of error. + + + <function>linkinfo</function> example + + +]]> + + + See also symlink, link, and readlink. diff --git a/reference/filesystem/functions/readlink.xml b/reference/filesystem/functions/readlink.xml index e78f87b40b..d30e1e495b 100644 --- a/reference/filesystem/functions/readlink.xml +++ b/reference/filesystem/functions/readlink.xml @@ -1,5 +1,5 @@ - + @@ -17,6 +17,21 @@ function and returns the contents of the symbolic link path or 0 in case of error. + + + <function>readlink</function> example + + +]]> + + + See also is_link, symlink, and