Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:12348 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66424 invoked by uid 1010); 25 Aug 2004 23:21:08 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 63330 invoked from network); 25 Aug 2004 23:20:37 -0000 Received: from unknown (HELO ?193.29.205.125?) (193.29.205.125) by pb1.pair.com with SMTP; 25 Aug 2004 23:20:37 -0000 Received: from srv1bgp.conecto1.starybrowar.corp by [193.29.205.125] via smtpd (for pb1.pair.com [216.92.131.4]) with ESMTP; Thu, 26 Aug 2004 01:13:25 +0200 Received: from aue251.neoplus.adsl.tpnet.pl ([83.27.12.251]) by s1.conecto.pl with asmtp (Exim 4.34) id 1C074E-0008Re-BG for internals@lists.php.net; Thu, 26 Aug 2004 01:20:35 +0200 Received: from aue251.neoplus.adsl.tpnet.pl ([83.27.12.251]) by aue251.neoplus.adsl.tpnet.pl via smtpd (for srv1bgp.conecto1.starybrowar.corp [172.16.16.60]) with ESMTP; Thu, 26 Aug 2004 01:13:22 +0200 To: internals@lists.php.net Date: Thu, 26 Aug 2004 01:20:30 +0200 User-Agent: KMail/1.6.82 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_+6RLB8wgwnWGt+0" Message-ID: <200408260120.30647.mg@iceni.pl> Subject: [PATCH] Bug #28371 (Different behaviour of fopen depending on r+,w+,a+) From: mg@iceni.pl (Marcin =?iso-8859-2?q?Gibu=B3a?=) --Boundary-00=_+6RLB8wgwnWGt+0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, here's a patch proposal for bug #28371. ftruncate() doesn't update file position and all further writes go to the old location. (or is it an undocumented feature?) -- mg --Boundary-00=_+6RLB8wgwnWGt+0 Content-Type: text/x-diff; charset="us-ascii"; name="28371.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="28371.diff" --- php-5.0.1/main/streams/plain_wrapper.c 2004-07-31 13:00:10.000000000 +0200 +++ php-5.0.1-patch/main/streams/plain_wrapper.c 2004-08-26 01:03:53.328106456 +0200 @@ -732,6 +732,7 @@ return fd == -1 ? PHP_STREAM_OPTION_RETURN_ERR : PHP_STREAM_OPTION_RETURN_OK; case PHP_STREAM_TRUNCATE_SET_SIZE: + stream->position = *(size_t*) ptrparam; return ftruncate(fd, *(size_t*)ptrparam) == 0 ? PHP_STREAM_OPTION_RETURN_OK : PHP_STREAM_OPTION_RETURN_ERR; } --Boundary-00=_+6RLB8wgwnWGt+0--