Return to disk_total_space_basic.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / file |
1.1 misho 1: --TEST-- 2: Test disk_total_space() function : basic functionality 3: --FILE-- 4: <?php 5: /* 6: * Prototype: float disk_total_space( string $directory ); 7: * Description: given a string containing a directory, this function will 8: * return the total number of bytes on the corresponding filesyatem 9: * or disk partition. 10: */ 11: 12: $file_path = dirname(__FILE__); 13: 14: echo "*** Testing with normal directory ***\n"; 15: var_dump( disk_total_space($file_path) ); 16: 17: echo "*** Testing with newly created directory ***\n"; 18: $dir = "/disk_total_space"; 19: 20: mkdir($file_path.$dir); 21: var_dump( disk_total_space($file_path.$dir) ); 22: $fh = fopen($file_path.$dir."/disk_total_space.tmp", "w"); 23: fwrite($fh, (binary)"Garbage Data Garbage Data Garbage Data Garbage Data Garbage Data Garbage Data Garbage Data"); 24: 25: fclose($fh); 26: 27: echo"\nTotal Space after writing to a file\n"; 28: var_dump( disk_total_space($file_path.$dir) ); 29: 30: echo"\n-- Done --"; 31: ?> 32: --CLEAN-- 33: <?php 34: $file_path = dirname(__FILE__); 35: unlink($file_path."/disk_total_space/disk_total_space.tmp"); 36: rmdir($file_path."/disk_total_space"); 37: ?> 38: 39: --EXPECTF-- 40: *** Testing with normal directory *** 41: float(%d) 42: *** Testing with newly created directory *** 43: float(%d) 44: 45: Total Space after writing to a file 46: float(%d) 47: 48: -- Done --