Re: [PHP-DEV] Scheme identification in stream wrappers: (Partial) disambiguation?

2005-04-10 Thread Morgan L. Owens
Wez Furlong wrote: On Apr 9, 2005 6:07 AM, Morgan L. Owens <[EMAIL PROTECTED]> wrote: > Really? > Can you guarantee that your user-space code to sniff out the path is > going to work 100% of the time on all platforms? > Who said user-space? I meant in the implementation of fopen(). fopen() is impl

Re: [PHP-DEV] Scheme identification in stream wrappers: (Partial) disambiguation?

2005-04-09 Thread Wez Furlong
On Apr 9, 2005 6:07 AM, Morgan L. Owens <[EMAIL PROTECTED]> wrote: > > Really? > > Can you guarantee that your user-space code to sniff out the path is > > going to work 100% of the time on all platforms? > > > Who said user-space? I meant in the implementation of fopen(). fopen() is implement

Re: [PHP-DEV] Scheme identification in stream wrappers: (Partial) disambiguation?

2005-04-09 Thread Morgan L. Owens
Wez Furlong wrote: > > Really? > Can you guarantee that your user-space code to sniff out the path is > going to work 100% of the time on all platforms? > Who said user-space? I meant in the implementation of fopen(). > > It's not just 1 letter. There are 3 letter special device names too. > Natch

Re: [PHP-DEV] Scheme identification in stream wrappers: (Partial) disambiguation?

2005-04-07 Thread Wez Furlong
> If there's something that looks like a scheme (i.e., a well-formed > sequence of > characters followed by ':'), > see if it's registered; > if it is, > the appropriate wrapper should be used. > Otherwise, > on platforms where ':' has signifi

Re: [PHP-DEV] Scheme identification in stream wrappers: (Partial) disambiguation?

2005-04-06 Thread Morgan L. Owens
If there's something that looks like a scheme (i.e., a well-formed sequence of characters followed by ':'), see if it's registered; if it is, the appropriate wrapper should be used. Otherwise, on platforms where ':' has significance, try it again as a file path. Otherwise, it fails due t

Re: [PHP-DEV] Scheme identification in stream wrappers

2005-04-06 Thread Sara Golemon
> It's not 'nix you want to worry about, but systems where : identifies > a drive or device; win32, vms (?), (and Amiga, if that still counts :) > Doi, drive letters So yeah that can be worked around with a: #ifdef PHP_WIN32 if (p = path+1 && isalpha(*path) && (*p == '/' || *p == '\\')) { /*

Re: [PHP-DEV] Scheme identification in stream wrappers

2005-04-06 Thread Wez Furlong
It's not 'nix you want to worry about, but systems where : identifies a drive or device; win32, vms (?), (and Amiga, if that still counts :) Could be more trouble than its worth, BC wise. --Wez. On Apr 6, 2005 11:02 AM, Sara Golemon <[EMAIL PROTECTED]> wrote: > The only thing that positively lea

Re: [PHP-DEV] Scheme identification in stream wrappers

2005-04-06 Thread Sara Golemon
You know, I could have sworn that I only looked for a : as the separator. Not according to php_stream_locate_url_wrapper(): for (p = path; isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'; p++) n++; if ((*p == ':') && (n > 1) && !strncmp("://", p, 3)) { protocol = path; } e

Re: [PHP-DEV] Scheme identification in stream wrappers

2005-04-06 Thread Wez Furlong
You know, I could have sworn that I only looked for a : as the separator. I seem to remember a discussion about this in the past, but don't recall the details. Would you mind searching the archives for the old php-dev mailing list to see if you can find anything else on this matter? --Wez. On Apr