3 * Prototype: float disk_free_space( string directory )
4 * Description: Given a string containing a directory, this function will
5 * return the number of bytes available on the corresponding
6 * filesystem or disk partition
9 echo "*** Testing error conditions ***\n";
10 $file_path = dirname(__FILE__
);
11 var_dump( disk_free_space() ); // Zero Arguments
12 var_dump( diskfreespace() );
14 var_dump( disk_free_space( $file_path, "extra argument") ); // More than valid number of arguments
15 var_dump( diskfreespace( $file_path, "extra argument") );
18 var_dump( disk_free_space( $file_path."/dir1" )); // Invalid directory
19 var_dump( diskfreespace( $file_path."/dir1" ));
21 $fh = fopen( $file_path."/disk_free_space.tmp", "w" );
22 fwrite( $fh, " Garbage data for the temporary file" );
23 var_dump( disk_free_space( $file_path."/disk_free_space.tmp" )); // file input instead of directory
24 var_dump( diskfreespace( $file_path."/disk_free_space.tmp" ));
29 $file_path = dirname(__FILE__
);
30 unlink($file_path."/disk_free_space.tmp");