Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120899 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 85488 invoked from network); 14 Aug 2023 17:49:52 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 14 Aug 2023 17:49:52 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A06331804C9 for ; Mon, 14 Aug 2023 10:49:51 -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, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 14 Aug 2023 10:49:51 -0700 (PDT) Received: by mail-ot1-f53.google.com with SMTP id 46e09a7af769-6bca38a6618so3930138a34.3 for ; Mon, 14 Aug 2023 10:49:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692035390; x=1692640190; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=wmZ4FEIx21tg4qvnuYPRf9nOR7sB4ad3aebLcqDrOHg=; b=VMprOn6X+3Ir6ygWsIpKQfZjPzq07Qer20A5asKBbOBY8sAd5rIllM+c9D6iyIZYro NW2EVS8Bys+9x3H5fjJUZojae+w/qJSZhkpHaWwT1ci0au6r3Iuc5gZAmwefFT05a2pI K+q7oHnWegS5VM2C5VxgwisBmoAUJiPhyHZeA86fIUxMpe5GKGii7OIUWaIfUTLWCGbb uBRGaLsyv86qk/8VWiYRaRqpOzfQzw50ZL8zXRZuablnt/E9GaezZ3nBqDEKYO8/0UC0 /d3G2E8oY5wlpaknJkKEhp5tefCKOPkuAZKqPtnuRiSKdL4xKgvwFL3qMzqaWMV/Rk4f ghMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692035390; x=1692640190; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wmZ4FEIx21tg4qvnuYPRf9nOR7sB4ad3aebLcqDrOHg=; b=XdRMm+mO/w8uCiQqr2qb8M+W0kPbw2hWgx+T/LMtmnAd+WwqpsKK1oObIz9aI7PNRc TUORvjW17TPgRQbDC20A/2tmM3A9TShMFzoHT9261yA1ZZIGdLtcpSQEoHp9e8Pq/8Ww w6XLeeQrNuE3W4mcW2hqXcZXKSVmkBGhpj89y/y6XD48/H2y/MZM9ZHLVuC3w1T7vsnd jG4+CiKjjQ77qajQsCwEW7HNhXt7Fi/WlyyYkR2U48D5LZPcMR3wfJDfR5F9SyIJbr1B Axf9VIlbKU3C/d8M3qq4SINjKN0HPjx/uNzmOPjDU0n3tiGKG0irpKWz5649AtjtvknL 41Qw== X-Gm-Message-State: AOJu0Yz3/cSlccBIOLobWbeH1qbS2r1nbslUEHMKEanRVbUDkFtGDdM5 GEfpqIySepkA/+D8vwJaaf5txhrjmMc= X-Google-Smtp-Source: AGHT+IEAdE0AKSefdd9GiX1WRWtuJiWaSSnNQhXoG14etjt8X+WKZaa5IC6J0L0xCpgLsZZM94p4wQ== X-Received: by 2002:a05:6870:c6a6:b0:1bb:85c3:9293 with SMTP id cv38-20020a056870c6a600b001bb85c39293mr11638524oab.41.1692035389768; Mon, 14 Aug 2023 10:49:49 -0700 (PDT) Received: from localhost ([177.37.45.169]) by smtp.gmail.com with ESMTPSA id x5-20020a056870740500b001bfd65998aesm5370905oam.58.2023.08.14.10.49.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Aug 2023 10:49:49 -0700 (PDT) Date: Mon, 14 Aug 2023 14:49:36 -0300 To: internals@lists.php.net Message-ID: References: <2446443.ElGaqSPkdT@come-prox15amd> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2446443.ElGaqSPkdT@come-prox15amd> Subject: Re: [PHP-DEV] [RFC] Support optional suffix parameter in tempnam From: athoscribeiro@gmail.com (Athos Ribeiro) On Mon, Aug 14, 2023 at 05:57:53PM +0200, Côme Chilliet wrote: >Le mardi 8 août 2023, 21:11:01 CEST Athos Ribeiro a écrit : >> Hi internals, >> >> As a follow-up on my previous message here >> (https://marc.info/?l=php-internals&m=168912164828942&w=2), >> I would like to start the discussion on the "Support optional suffix >> parameter in tempnam" RFC. >> https://wiki.php.net/rfc/tempnam-suffix-v2 > >Hello, > >The RFC does not explain what benefits brings using tempnam($directory, $prefix, $suffix) over using tempnam($directory, $prefix).$suffix , which you can already use? > >Côme Hi Côme, Thanks for the input and for going through the proposal. As the tempnam short description (https://www.php.net/manual/en/function.tempnam.php) states tempnam — __Create__ file with unique file name So tempnam 1) creates a file with specific permissions in a given path ($directory); and 2) returns the full path of the created file on success. For the sole purpose of obtaining a file path (2), I see no reasons for not using "tempnam($directory, $prefix).$suffix" as you suggested. However, to create the temporary file (1) allowing appending a suffix string to the created file, we would need to change tempnam. This is the purpose of this RFC. In other words, although the return value of "tempnam($directory, $prefix).$suffix" and the proposed "tempnam($directory, $prefix, $suffix)" __may__ be the same, the outcome of running each of those, is not. The second paragraph of the RFC introduction says "It would be useful to allow users to also specify a suffix when __generating__ temporary files. [...]" Do you have any suggestions on how we could improve the RFC introduction text to make this clearer to readers of this RFC? -- Athos Ribeiro