Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110394 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 43304 invoked from network); 5 Jun 2020 23:17:41 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Jun 2020 23:17:41 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 42D7D1804E1 for ; Fri, 5 Jun 2020 15:00:27 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-oi1-f195.google.com (mail-oi1-f195.google.com [209.85.167.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 5 Jun 2020 15:00:26 -0700 (PDT) Received: by mail-oi1-f195.google.com with SMTP id 25so8572523oiy.13 for ; Fri, 05 Jun 2020 15:00:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=2peFGonqOIBEITsRboxNKNlbzu6qaM6I4oPoO/L/VUw=; b=XdxsqeZUfiC4Nq42ChhYl7b3dpMbZXqwkW7pisE9stYVKKCNKItOD/IfkevGcVWHS/ 5Xp/QkKsVR+kQDh8j67UU2X4SSVtmR6pwW23tok81tXdBIQ6PGfOAZ/UYCGxWRIwKA8O N1DtB6LmAinUVuOnWKXhZvbJhrHFJruIC5Wj2+GVL1IGYjkh/4FdCHTY9fnn38j+B94i kKB7GhX1sJ2LOwtrA0fneT8cMcxZRnI+87y0pt1TnZLkO0/gD4aVbI1Uzf2x3UL/EQLU KjgSKKiLF+9N35feqOqL9OyH/X0/tutTASeXzIWSkM2QkCzjPzkF91vwyvg20WzAr6Ln 4PGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=2peFGonqOIBEITsRboxNKNlbzu6qaM6I4oPoO/L/VUw=; b=In7/OhY0xMTTe7yVcx4c4Mg0VQr4TJlRUyVC99lS4Av/XMaQ0aaIW65sTgfYQsXpO3 0LmODq7KUSNpE9Io6kaXjxFMpiethQf4lmePeFr1HMndYnAzRNdyc5GimRDSKc88jCWf 3N2lpbBgFyaXP2oIq/Ow/ycOXzAZ6cd4rKF1sOF+yYHOj+i4xBxSyQWpsLEKdl+ZRgyT lY8fFhJqWZH8Bp2jNk3XdPGdZ6xSKVEE2rgGdWbY5ewf5Ibc+wnGfw4+dVht7qvzT5sj ikRSlH4h1jYIN4UGqQ089UEnj3tZk+a1SAeoD0lYMry6gqf7J+qTJxCWmU9Klmoqc0jf QhLQ== X-Gm-Message-State: AOAM531ZwLXQRXaYE1FnKkd8RewT1OT3knNnZATCOBXd1HiW1F8xxqZ8 3XkeD/vKvnDwlNwo8fjDixq612ooD4RZduOOrRhKohUO X-Google-Smtp-Source: ABdhPJz+01V+cEmJPYZBeFKzy/n6Lf+TEz8JQH+mb+F/9e5vrZoJtohDoAnqYJI0Xg29xz3hXRET85RoB9dXXd2pdQY= X-Received: by 2002:aca:b584:: with SMTP id e126mr3168566oif.7.1591394426041; Fri, 05 Jun 2020 15:00:26 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 5 Jun 2020 23:00:15 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="00000000000076382305a75d63bd" Subject: Re: [PHP-DEV] RFC proposal: fsync support for file resources From: davidgebler@gmail.com (David Gebler) --00000000000076382305a75d63bd Content-Type: text/plain; charset="UTF-8" As a side-note, I am unable to register a wiki.php.net account to raise this RFC, I get a very unhelpful error message which just says "That wasn't the answer we were expecting" when I submit my details. Anyone have any idea what that is? On Thu, Jun 4, 2020 at 3:19 PM David Gebler wrote: > It's interesting that you mention fdatasync - perhaps a better C > programmer than I am can correct me, but I don't think it has an equivalent > on Windows, where _commit() is a wrap on FlushFileBuffers API. So in > respect of PHP implementation, the options would be: > > fdatasync() is not available on Windows, but fsync() is. fdatasync() is > available on UNIX builds. > > fdatasync() on Windows is an alias of fsync(), on UNIX fdatasync() is as > expected. > > Only fsync() is implemented for both Windows and Unix. > > -Dave > > On Wed, 3 Jun 2020, 11:16 Nikita Popov, wrote: > >> On Mon, Jun 1, 2020 at 6:57 PM David Gebler >> wrote: >> >>> Exactly as the subject says, I would like to propose an RFC for adding an >>> fsync() function for file resources, which would in essence be a thin >>> wrapper around C's fsync on UNIX systems and _commit on Windows. >>> >>> 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 am not really a C programmer and I have been able to implement a simple >>> working prototype of this as a compiled extension in merely a few hours, >>> so >>> I'm sure it wouldn't be difficult to bring in to the language core where >>> the functionality really belongs. >>> >>> Every other major programming language otherwise comparable to PHP in >>> features supports a way of providing durability. >>> >>> Thanks. >>> >> >> No objections from my side. I assume you'd want to add both fsync() and >> fdatasync()? >> >> I think all it takes for this one is a PR... >> >> Regards, >> Nikita >> > --00000000000076382305a75d63bd--