Re: File-Paths exceeding MAX_PATH on Windows

From: Date: Tue, 08 Jan 2013 22:45:51 +0000
Subject: Re: File-Paths exceeding MAX_PATH on Windows
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.internals 
Request: Send a blank email to internals+get-64708@lists.php.net to get a copy of this message
On Tue, Jan 8, 2013 at 10:06 PM, Nicolai Scheer <nicolai.scheer@gmail.com> wrote: > Hi again! > > > On 8 January 2013 14:56, Nicolai Scheer <nicolai.scheer@gmail.com> 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

« previous php.internals (#64708) next »