iliaa           Sun Mar 30 15:06:07 2008 UTC

  Modified files:              
    /php-src/ext/standard       file.c 
  Log:
  MFB:  Added a warning message
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.514&r2=1.515&diff_format=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.514 php-src/ext/standard/file.c:1.515
--- php-src/ext/standard/file.c:1.514   Thu Feb 28 14:16:14 2008
+++ php-src/ext/standard/file.c Sun Mar 30 15:06:07 2008
@@ -21,7 +21,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: file.c,v 1.514 2008/02/28 14:16:14 felipe Exp $ */
+/* $Id: file.c,v 1.515 2008/03/30 15:06:07 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -624,6 +624,7 @@
        php_stream_context *context = NULL;
        char mode[3] = { 'w', 0, 0 };
        php_stream *srcstream = NULL;
+       char mode[3] = "wb";
 
        if (zend_parse_parameters(argc TSRMLS_CC, "Zz/|lr!", &ppfilename, 
&data, &flags, &zcontext) == FAILURE) {
                return;
@@ -655,9 +656,14 @@
 
        if (flags & LOCK_EX && (!php_stream_supports_lock(stream) || 
php_stream_lock(stream, LOCK_EX))) {
                php_stream_close(stream);
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Exclusive locks 
are not supported for this stream");
                RETURN_FALSE;
        }
 
+       if (mode[0] = 'c') {
+               php_stream_truncate_set_size(stream, 0);
+       }
+
        switch (Z_TYPE_P(data)) {
                case IS_RESOURCE:
                        numchars = php_stream_copy_to_stream(srcstream, stream, 
PHP_STREAM_COPY_ALL);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to