]> granicus.if.org Git - php/commitdiff
- cs
authorPierre Joye <pajoye@php.net>
Sat, 30 Jan 2010 17:56:00 +0000 (17:56 +0000)
committerPierre Joye <pajoye@php.net>
Sat, 30 Jan 2010 17:56:00 +0000 (17:56 +0000)
ext/standard/tests/file/tempnam_variation7-win32.phpt

index 5096934e039cb44df2ebdea46078fa76c9fe5b57..2bc69dba53f4bc604e1b47da771cbee855b21240 100644 (file)
@@ -17,50 +17,47 @@ if(substr(PHP_OS, 0, 3) != "WIN")
 echo "*** Testing tempnam() with invalid/non-existing directory names ***\n";
 /* An array of names, which will be passed as a dir name */ 
 $names_arr = array(
-  /* Invalid args */ 
-  -1,
-  TRUE,
-  FALSE,
-  NULL,
-  "",
-  " ",
-  "\0",
-  array(),
-
-  /* Non-existing dirs */
-  "/no/such/file/dir", 
-  "php"
+       /* Invalid args */ 
+       -1,
+       TRUE,
+       FALSE,
+       NULL,
+       "",
+       " ",
+       "\0",
+       array(),
 
+       /* Non-existing dirs */
+       "/no/such/file/dir", 
+       "php"
 );
 
 for( $i=0; $i<count($names_arr); $i++ ) {
-  echo "-- Iteration $i --\n";
-  $file_name = tempnam($names_arr[$i], "tempnam_variation3.tmp");
+       echo "-- Iteration $i --\n";
+       $file_name = tempnam($names_arr[$i], "tempnam_variation3.tmp");
+
+       if( file_exists($file_name) ){
+
+               echo "File name is => ";
+               print($file_name);
+               echo "\n";
 
-  if( file_exists($file_name) ){
+               echo "File permissions are => ";
+               printf("%o", fileperms($file_name) );
+               echo "\n";
 
-    echo "File name is => ";
-    print($file_name);
-    echo "\n";
+               echo "File created in => ";
+               $file_dir = dirname($file_name);
+               if (realpath($file_dir) == realpath(sys_get_temp_dir()) || realpath($file_dir."\\") == realpath(sys_get_temp_dir())) {
+                       echo "temp dir\n";
+               } else {
+                       echo "unknown location\n";
+               }
+       } else {
+               echo "-- File is not created --\n";
+       }
 
-    echo "File permissions are => ";
-    printf("%o", fileperms($file_name) );
-    echo "\n";
-    
-    echo "File created in => ";
-    $file_dir = dirname($file_name);
-    if (realpath($file_dir) == realpath(sys_get_temp_dir()) || realpath($file_dir."\\") == realpath(sys_get_temp_dir())) {
-       echo "temp dir\n";
-    }
-    else {
-       echo "unknown location\n";
-    }                
-  }
-  else { 
-    echo "-- File is not created --\n";
-  }
-  unlink($file_name);
+       unlink($file_name);
 }
 
 echo "\n*** Done ***\n";