Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64708 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8224 invoked from network); 8 Jan 2013 22:45:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Jan 2013 22:45:55 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.180 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.217.180 mail-lb0-f180.google.com Received: from [209.85.217.180] ([209.85.217.180:53570] helo=mail-lb0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E6/28-16636-2A1ACE05 for ; Tue, 08 Jan 2013 17:45:54 -0500 Received: by mail-lb0-f180.google.com with SMTP id gj3so771720lbb.39 for ; Tue, 08 Jan 2013 14:45:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=H60aleRXNI/CqqoBNV95XZXEng9brzU5DKgJNY5zYz4=; b=bzsIbBw7CSOmdKIPuC4YGHSBKIWBCcotVkqvJxKw0Pn9nN+Gc3kvyaJZjxfnYF+lJ1 mgmpRj8EDxOx7HOmtw1j57Jh/14Fy54+8cf7HWjwfjYOAzunMdCLDBvyAIZmy3ezfyek Kh5ofNIRFuffbc8EvpEV/CBsBASQ0zpFvBAtQZlnQ/M7EvwPF2AxBzppFWYHLY+z7Mw2 I7FPnPXFUCLLCTMX5ue6XrpU3Qry+7+khsKI/5VC8ZGfaaQUhqibLyqSxaBD8RnO2zU7 qEdH/wPzkPeeetAZGJlAOCsajei32uF+YBhjJTo83tW+G8+AQmoNOMToUkxsO3OGPrxW KCXQ== MIME-Version: 1.0 Received: by 10.112.44.161 with SMTP id f1mr26490952lbm.29.1357685151237; Tue, 08 Jan 2013 14:45:51 -0800 (PST) Received: by 10.112.127.230 with HTTP; Tue, 8 Jan 2013 14:45:51 -0800 (PST) In-Reply-To: References: Date: Tue, 8 Jan 2013 23:45:51 +0100 Message-ID: To: Nicolai Scheer Cc: PHP internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] File-Paths exceeding MAX_PATH on Windows From: pierre.php@gmail.com (Pierre Joye) On Tue, Jan 8, 2013 at 10:06 PM, Nicolai Scheer wrote: > Hi again! > > > On 8 January 2013 14:56, Nicolai Scheer wrote: >> >> >> Do you have any advice how I can move lill' pandora to an extension? Of >> course I might copy the complete simple_file_wrapper, but I'd rather not do >> it that way... I did not find any "add standard stream context option"-stuff >> in the API... >> > > I did finish to write a small extension this evening, which does what I want > :) > > I just saved a copy of the php_plain_files_wrapper struct, deregistered the > file wrapper during my MINIT, injected my own functions into the struct and > registered it again. > My own functions just wrap the original ones (using the saved original > function pointers), adjust STREAM_ASSUME_REALPATH and add the prefix if > necessary. > > Adjustments only kick in for paths exceeding MAX_PATH, so if all paths are > within the usually allowed bounds, everything is back to original. > > Quick and dirty, but it works very well and is a feasible way for our > project... until there's a better way :) nice :) that's exactly what I meant earlier, much easier than implementing a wrapper and safer than allowing special paths. Now be sure to do not mess with the libs :) Cheers, -- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org