2 Test copy() function: basic functionality
5 /* Prototype: bool copy ( string $source, string $dest );
6 * Description: Makes a copy of the file source to dest.
7 * Returns TRUE on success or FALSE on failure.
10 echo "*** Testing copy() function: to copy file from source to destination --\n";
12 var_dump( file_exists(__FILE__) );
14 /* copying the file */
15 $file_path = dirname(__FILE__);
16 $file_name1 = $file_path."/copy_basic1.tmp";
17 $file_name2 = $file_path."/copy_basic2.tmp";
18 var_dump( copy(__FILE__, $file_name1) );
19 var_dump( copy($file_name1, $file_name2) );
21 echo "-- Checking whether the copy of file exists --\n";
22 var_dump( file_exists($file_name1) );
23 var_dump( file_exists($file_name2) );
25 echo "-- Checking filepermissions of file and its copies --\n";
26 printf( "%o", fileperms(__FILE__) );
28 printf( "%o", fileperms($file_name1) );
30 printf( "%o", fileperms($file_name2) );
33 echo "*** Done ***\n";
38 $file_path = dirname(__FILE__);
39 $file_name1 = $file_path."/copy_basic1.tmp";
40 $file_name2 = $file_path."/copy_basic2.tmp";
46 *** Testing copy() function: to copy file from source to destination --
50 -- Checking whether the copy of file exists --
53 -- Checking filepermissions of file and its copies --