Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52128 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84499 invoked from network); 1 May 2011 19:23:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 May 2011 19:23:52 -0000 Authentication-Results: pb1.pair.com smtp.mail=christian.kaps@mohiva.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=christian.kaps@mohiva.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mohiva.com from 178.63.228.54 cause and error) X-PHP-List-Original-Sender: christian.kaps@mohiva.com X-Host-Fingerprint: 178.63.228.54 elvis.mohiva.com Linux 2.6 Received: from [178.63.228.54] ([178.63.228.54:42756] helo=elvis.mohiva.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 50/74-10915-643BDBD4 for ; Sun, 01 May 2011 15:23:51 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by elvis.mohiva.com (Postfix) with ESMTP id 4B1AD1DBE0A9 for ; Sun, 1 May 2011 21:23:47 +0200 (CEST) X-Virus-Scanned: amavisd-new at mohiva.com Received: from elvis.mohiva.com ([127.0.0.1]) by localhost (elvis.mohiva.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7ydHvDxt+ffe for ; Sun, 1 May 2011 21:23:46 +0200 (CEST) Received: from [192.168.0.3] (p57B54C1E.dip.t-dialin.net [87.181.76.30]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: christian.kaps@mohiva.com) by elvis.mohiva.com (Postfix) with ESMTPSA id 81F4D1DBE08D for ; Sun, 1 May 2011 21:23:45 +0200 (CEST) Message-ID: <4DBDB340.2090800@mohiva.com> Date: Sun, 01 May 2011 21:23:44 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110430 Lightning/1.0b3pre Thunderbird/3.1.10 MIME-Version: 1.0 To: PHPMailingList Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Access a temporary file created by SplTempFileObject by another file handle instance From: christian.kaps@mohiva.com (Christian Kaps) Hi, is there any reason why a temporary file created with SplTempFileObject isn't accessible by another e.g. SplFileObject instance. $temp = new SplTempFileObject(); $temp->fwrite('A string'); var_dump($temp->getPathname()); The var_dump call returns always the PHP stream URL php://temp. Why the method getPathname doesn't return a unique ID in the URL(php://temp/ertZ789) which references to this temporary file. So it would be posible to access this temporary file by another e.g. SplFileObject instance. For testing purpose this would be a great benefit. With a SplTempFileObject instance a test fixture could be created in RAM. It would like a virtual file system for one file. Greetings Christian