X-Recipient: archive-cygwin AT delorie DOT com X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DC7973858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=yandex.ru Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=yandex.ru X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1664719502; bh=McbjAlRjcrmRGIy1a9j8go+reDKbPkn6lFewt1+GTwo=; h=In-Reply-To:Subject:Date:References:To:Message-ID:Reply-To:From; b=Iv4vm7v0Jy/SNAAKoFPPxe/bWwu/PfMJKjqschSVIQruyNn1b7uVvjtJGTBkrBPei I+nx3OI4x6Zwp2LPstjO7xL7GdHbFVIPe8isPdl8fsQN5WuTeSeLQnlPiFLWacqTrI tR2j4M+t/c9WH2r3icxc23ZfrNCU3l/E9NZpV8/s= Authentication-Results: sas2-e7f6fb703652.qloud-c.yandex.net; dkim=pass header.i=@yandex.ru Date: Sun, 2 Oct 2022 16:58:31 +0300 From: Andrey Repin X-Mailer: The Bat! (v9.3.4) Professional Message-ID: <983132575.20221002165831@yandex.ru> To: Ken Brown , cygwin AT cygwin DOT com Subject: Re: Cygwin 3.3.6: PHP's SplFileObject::fwrite seems broken In-Reply-To: <31835bd3-21f9-8db5-bb9b-cd7e324364fc@cornell.edu> References: <31835bd3-21f9-8db5-bb9b-cd7e324364fc AT cornell DOT edu> MIME-Version: 1.0 X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_THEBAT, NICE_REPLY_A, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: cygwin AT cygwin DOT com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Greetings, Ken Brown! > On 10/2/2022 1:16 AM, Hans Henrik Bergan wrote: >> ... actually i forgot that the default fopen mode is "rb" > [...] >> changing the code to SplFileObject("bug.txt", "rb"); >> makes the code work > I don't think you wrote what you meant. You're not saying that explicitly > specifying the default value changes the behavior, are you? Maybe you meant to say that the default mode is "r"? "b" is always assumed, unless "t" is explicitly given. I just checked and I can't get the code to work even if I manually specify the open mode. While Windows PHP version displays the notice as it should: $ php -d "error_reporting=-1" -d "display_errors=stderr" -r '(new SplFileObject("test.txt"))->fwrite("test");' PHP Notice: SplFileObject::fwrite(): write of 4 bytes failed with errno=9 Bad file descriptor in Command line code on line 1 -- With best regards, Andrey Repin Sunday, October 2, 2022 16:49:51 Sorry for my terrible english... -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple