zoe Wed Jun 6 12:53:17 2007 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/standard/tests/file file.inc
Log:
fixed file permission for new empty file
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/file.inc?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/standard/tests/file/file.inc
diff -u php-src/ext/standard/tests/file/file.inc:1.1.2.2
php-src/ext/standard/tests/file/file.inc:1.1.2.3
--- php-src/ext/standard/tests/file/file.inc:1.1.2.2 Tue Jun 5 08:02:17 2007
+++ php-src/ext/standard/tests/file/file.inc Wed Jun 6 12:53:17 2007
@@ -63,7 +63,7 @@
return false;
}
- $tmp_buff = str_repeat($data, ($chunk_size/$size_divider) + $add_value );
+ $tmp_buff = str_repeat($data, ($fill_size/$size_divider) + $add_value );
if ( strlen($tmp_buff) > $fill_size ) {
$buffer = substr($tmp_buff, 0, $fill_size);
@@ -273,27 +273,26 @@
if ( $content_type == "empty" ) {
$return_value['filled'] = $count;
- return $return_value;
- }
-
- // fill the file with specifiec type of data and size
- $tmp_name_suffix = $name_suffix;
- for($loop_counter = 1; $loop_counter <= $count; $loop_counter ++) {
- $filename = $file_path."/".$name_prefix.$tmp_name_suffix.$file_extension;
- $file_handle = fopen($filename, $mode);
- if($file_handle == false) {
- fclose($file_handle);
- return $return_value;
- } // end of if
+ } else {
+ // fill the file with specifiec type of data and size
+ $tmp_name_suffix = $name_suffix;
+ for($loop_counter = 1; $loop_counter <= $count; $loop_counter ++) {
+ $filename = $file_path."/".$name_prefix.$tmp_name_suffix.$file_extension;
+ $file_handle = fopen($filename, $mode);
+ if($file_handle == false) {
+ fclose($file_handle);
+ return $return_value;
+ } // end of if
- // call fill_file() to fill the file
- if( fill_file($file_handle, $content_type, $file_size) )
- $return_value['filled']++;
+ // call fill_file() to fill the file
+ if( fill_file($file_handle, $content_type, $file_size) )
+ $return_value['filled']++;
- fclose($file_handle);
+ fclose($file_handle);
- $tmp_name_suffix++;
- } // end of for
+ $tmp_name_suffix++;
+ } // end of for
+ }
// change all file's permissions
$return_value['perms_changed'] = change_file_perms($file_path, $count,
$permission, $name_prefix,
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php