Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75352 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73508 invoked from network); 10 Jul 2014 09:13:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jul 2014 09:13:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=julienpauli@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=julienpauli@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.182 as permitted sender) X-PHP-List-Original-Sender: julienpauli@gmail.com X-Host-Fingerprint: 209.85.220.182 mail-vc0-f182.google.com Received: from [209.85.220.182] ([209.85.220.182:41358] helo=mail-vc0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E7/01-65406-1595EB35 for ; Thu, 10 Jul 2014 05:13:54 -0400 Received: by mail-vc0-f182.google.com with SMTP id il7so10191471vcb.27 for ; Thu, 10 Jul 2014 02:13:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=7N1WU/Ch12pvY/lnl9s789jydgA9WYULYHK0exAIrAE=; b=Zoorlzt8IO5FwhwIjqbKKqDXVy+9wa4zE0jIx0tjX1dyT5KNdSAxhWDBOoiHh1gtIX WPi6wvbifNuUE3F5QLwLAt4vAMqVi4qUvC/sH6v4thLM7bI1roB253gRtY8GFVTWy/Sv KyXs+s8Z7Px6l/PrjT9RfB0Fs1wZPrQC+wAwTyxsdEf3c4nZsYTCZPAL8KmfG5/JJiAW G7eqzDCzq2YEWJ0MtuNLD8Dtc4vyMYHIQy8A74DaYRqRl06LbWBwT7Fm9ogNmtcaQ43M A4tzc+8LCcSaQwgx6pPUojyb3uexy+pZaA6P0xy5aIpwcfVbVuPFAgh1kV1FoznqN45W 1W6g== X-Received: by 10.52.232.200 with SMTP id tq8mr15941805vdc.32.1404983630563; Thu, 10 Jul 2014 02:13:50 -0700 (PDT) MIME-Version: 1.0 Sender: julienpauli@gmail.com Received: by 10.220.81.68 with HTTP; Thu, 10 Jul 2014 02:13:10 -0700 (PDT) In-Reply-To: <53BBE484.2070807@hoa-project.net> References: <53BB9F9C.20308@hoa-project.net> <53BBE484.2070807@hoa-project.net> Date: Thu, 10 Jul 2014 11:13:10 +0200 X-Google-Sender-Auth: KbnzKtPmharELNiQPhV_XP_fwA4 Message-ID: To: "Ivan Enderlin @ Hoa" Cc: PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Implemented fallocate() syscall in streams From: jpauli@php.net (Julien Pauli) On Tue, Jul 8, 2014 at 2:31 PM, Ivan Enderlin @ Hoa wrote: > > On 08/07/2014 11:08, Julien Pauli wrote: >> >> On Tue, Jul 8, 2014 at 9:37 AM, Ivan Enderlin @ Hoa >> wrote: >>> >>> On 13/06/2014 16:20, Julien Pauli wrote: >>>> >>>> - One that relies on ftruncate() , and adds a $use_fallocate >>>> flag https://github.com/jpauli/php-src/tree/fallocate_flag >>>> >>>> Please, note that the latest proposal requires patches in different >>>> extensions, as I changed a PHP_API function signature. >>>> >>>> I don't know if Windows can support that. Pierre, Anatol ? :-) >>>> >>>> Tests are beeing written at the moment. >>>> >>>> I didn't implement this is user stream handlers, as this really is a >>>> low level implementation design that is kind of useless for usage in >>>> user streams. >>>> >>>> Thoughts ? >>> >>> If the first one is used, please, consider exposing it on the user-land >>> of >>> stream wrappers (exemple: `stream_allocate`) if possible. >> >> I find it very useless as user stream already have the ftruncate >> exposed to them. > > Hum no, this is very useful actually. A stream wrapper can be used to > represent a file somewhere else, imagine `ntfs://`, `smb://`, `aws://`, > `ftp://`, `afp://` etc. > > > >> The difference between ftruncate and fallocate is meaningless in userland. > > If `fallocate` is proposed in the user-land, then it will be logical to have > it in the stream wrapper API. That's it :-). I admit that it would be nice for consistency, however I wonder how users will interpret the difference between ftruncate and fallocate. Julien