zoe Wed Jun 6 12:48:13 2007 UTC Modified files: /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.3&r2=1.4&diff_format=u Index: php-src/ext/standard/tests/file/file.inc diff -u php-src/ext/standard/tests/file/file.inc:1.3 php-src/ext/standard/tests/file/file.inc:1.4 --- php-src/ext/standard/tests/file/file.inc:1.3 Tue Jun 5 07:54:58 2007 +++ php-src/ext/standard/tests/file/file.inc Wed Jun 6 12:48:13 2007 @@ -64,7 +64,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); @@ -274,27 +274,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