import zend standard tests
[hiphop-php.git] / hphp / test / zend / good / ext-standard-file / tempnam_variation5-win32.php
blob61e07c3bdcbb2334578e16fafdb41e30eb98539a
1 <?php
2 /* Prototype: string tempnam ( string $dir, string $prefix );
3 Description: Create file with unique file name.
4 */
6 /* Passing an existing file as $prefix for tempnam() fn */
8 $file_path = dirname(__FILE__);
10 echo "*** Test tempnam() function: by passing an existing filename as prefix ***\n";
11 $dir_name = $file_path."/tempnam_variation6";
12 mkdir($dir_name);
13 $h = fopen($dir_name."/tempnam_variation6.tmp", "w");
15 for($i=1; $i<=3; $i++) {
16 echo "-- Iteration $i --\n";
17 $created_file = tempnam("$dir_name", "tempnam_variation6.tmp");
19 if( file_exists($created_file) ) {
20 echo "File name is => ";
21 print($created_file);
22 echo "\n";
24 else
25 print("File is not created");
27 unlink($created_file);
29 fclose($h);
30 unlink($dir_name."/tempnam_variation6.tmp");
31 rmdir($dir_name);
33 echo "\n*** Done ***\n";