iliaa Fri May 19 02:51:18 2006 UTC
Modified files:
/php-src/ext/standard filestat.c
Log:
MFB: Fixed bug #37505 (touch() truncates large files).
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/filestat.c?r1=1.146&r2=1.147&diff_format=u
Index: php-src/ext/standard/filestat.c
diff -u php-src/ext/standard/filestat.c:1.146
php-src/ext/standard/filestat.c:1.147
--- php-src/ext/standard/filestat.c:1.146 Mon Apr 10 11:56:04 2006
+++ php-src/ext/standard/filestat.c Fri May 19 02:51:18 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: filestat.c,v 1.146 2006/04/10 11:56:04 sniper Exp $ */
+/* $Id: filestat.c,v 1.147 2006/05/19 02:51:18 iliaa Exp $ */
#include "php.h"
#include "fopen_wrappers.h"
@@ -504,7 +504,6 @@
{
zval **filename, **filetime, **fileatime;
int ret;
- struct stat sb;
FILE *file;
struct utimbuf newtimebuf;
struct utimbuf *newtime = NULL;
@@ -537,8 +536,7 @@
}
/* create the file if it doesn't exist already */
- ret = VCWD_STAT(Z_STRVAL_PP(filename), &sb);
- if (ret == -1) {
+ if (VCWD_ACCESS(Z_STRVAL_PP(filename), F_OK) != 0) {
file = VCWD_FOPEN(Z_STRVAL_PP(filename), "w");
if (file == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to
create file %s because %s", Z_STRVAL_PP(filename), strerror(errno));
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php