--TEST--
Test lstat() and stat() functions: error conditions
- --SKIPIF--
- <?php
- if (substr(PHP_OS, 0, 3) == 'WIN') {
- die('skip.. lstat() not available on Windows');
- }
- ?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
echo "*** Testing lstat() for error conditions ***\n";
$file_path = __DIR__;
-var_dump( lstat() ); // args < expected
-var_dump( lstat(__FILE__, 2) ); // args > expected
var_dump( lstat("$file_path/temp.tmp") ); // non existing file
var_dump( lstat(22) ); // scalar argument
-$arr = array(__FILE__);
-var_dump( lstat($arr) ); // array argument
echo "\n*** Testing stat() for error conditions ***\n";
-var_dump( stat() ); // args < expected
-var_dump( stat(__FILE__, 2) ); // file, args > expected
-var_dump( stat(__DIR__, 2) ); //dir, args > expected
var_dump( stat("$file_path/temp.tmp") ); // non existing file
var_dump( stat("$file_path/temp/") ); // non existing dir
--TEST--
Test lstat() and stat() functions: usage variations - effects of rename() on file
- --SKIPIF--
- <?php
- if (substr(PHP_OS, 0, 3) == 'WIN') {
- die('skip.. Not valid for Windows');
- }
- ?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
/* test the effects of rename() on stats of file */
$file_path = __DIR__;
--TEST--
Test lstat() and stat() functions: usage variations - hardlink
- --SKIPIF--
- <?php
- if (substr(PHP_OS, 0, 3) == 'WIN') {
- die('skip.. lstat() not available on Windows');
- }
- ?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
/* test the effects of is_link() on stats of hard link */
$file_path = __DIR__;
--TEST--
Test lstat() and stat() functions: usage variations - dir/file name stored in object
- --SKIPIF--
- <?php
- if (substr(PHP_OS, 0, 3) == 'WIN') {
- die('skip.. Not valid for Windows');
- }
- ?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
/* test for stats of dir/file when their names are stored in objects */
$file_path = __DIR__;
--TEST--
Test lstat() and stat() functions: usage variations - dir/file names in array
- --SKIPIF--
- <?php
- if (substr(PHP_OS, 0, 3) == 'WIN') {
- die('skip.. Not valid for Windows');
- }
- ?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
/* test for stats of dir/file when their names are stored in an array */
$file_path = __DIR__;
--TEST--
Test lstat() and stat() functions: usage variations - effects of rename() on dir
- --SKIPIF--
- <?php
- if (substr(PHP_OS, 0, 3) == 'WIN') {
- die('skip.. Not valid for Windows');
- }
- ?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
/* test the effects of rename() on stats of dir */
$file_path = __DIR__;
--TEST--
Test lstat() and stat() functions: usage variations - link names stored in array/object
- --SKIPIF--
- <?php
- if (substr(PHP_OS, 0, 3) == 'WIN') {
- die('skip.. lstat() not available on Windows');
- }
- ?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
/* test for stats of link when their names are stored in object and array */
$file_path = __DIR__;
--TEST--
Test lstat() and stat() functions: usage variations - writing data into file
- --SKIPIF--
- <?php
- if (substr(PHP_OS, 0, 3) == 'WIN') {
- die('skip.. Not valid for Windows');
- }
- ?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
$file_path = __DIR__;
require "$file_path/file.inc";