Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110330 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 27288 invoked from network); 1 Jun 2020 21:05:33 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 1 Jun 2020 21:05:33 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 759FB1804E4 for ; Mon, 1 Jun 2020 12:47:17 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,SPF_HELO_NONE, SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS1836 195.49.0.0/17 X-Spam-Virus: No X-Envelope-From: Received: from darkcity.gna.ch (darkcity.gna.ch [195.49.47.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 1 Jun 2020 12:47:16 -0700 (PDT) Received: from flatter.home (unknown [IPv6:2a02:1205:34fb:29c0:f41b:b746:5bed:990c]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTPSA id D656B6C1518; Mon, 1 Jun 2020 21:47:13 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) In-Reply-To: Date: Mon, 1 Jun 2020 21:47:13 +0200 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: <843C9840-7AFD-4A8F-9C90-06DC1882AB05@cschneid.com> References: To: David Gebler X-Mailer: Apple Mail (2.3608.80.23.2.2) Subject: Re: [PHP-DEV] RFC proposal: fsync support for file resources From: cschneid@cschneid.com (Christian Schneider) Am 01.06.2020 um 18:56 schrieb David Gebler : > It seems to me an odd oversight that this has never been implemented = in PHP > and means PHP has no way to perform durable file write operations, = making > it inherently unsuitable for any systems requiring more intensive I/O, > mission critical logs, auditing, etc. I think there is a misconception of the usefulness of fsync() here. First of all it does not *really* guarantee the data is safe from power = outages etc, see https://stackoverflow.com/a/706688 https://stackoverflow.com/a/725742 and other answers in that thread. Secondly I'd rather rely on something like a proper DB if not losing any = data is crucial. Trying to implement it in pure PHP and plain old files seems like using = the wrong tools for the job to me. While there is little reason not to add fsync() to PHP the importance = and benefits are IMHO not that big. - Chris