You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Wilfredo Sánchez <ws...@apple.com> on 2000/06/09 03:43:16 UTC
ap_os_canonical_filename() and friends
I need to (finally) implement case handling for Mac OS X, where you may
or may not have your document root on an case-insensitive volume. Given
that OS X will likely ship before using 2.0 is feasible, I'm starting with
1.3 and I'll port to 2.0 afterwards.
I have a couple of questions... First, I'm trying to figure out the
differences between these functions:
ap_os_canonical_filename()
ap_os_case_canonical_filename()
ap_os_systemcase_filename()
If ap_os_case_canonical_filename() is supposed to preserve the input
case, then what is its role?
Say I have a file /FooBar on disk, and I'm looking for a file "/fooBAR".
What's the result? Let's solve for HFS+ (case insensitive but
preserving), DOS FAT (case insensitive), and UFS (case sensitive). I think
I can fill in for ap_os_canonical_filename(), but I don't know about the
rest:
Input ap_ocf() ap_occf()
ap_osf()
HFS+ /fooBAR /FooBar ? ?
FAT /fooBAR /foobar ? ?
UFS /fooBAR /fooBAR /fooBAR /fooBAR
Second, we also have a macro CASE_BLIND_FILESYSTEM, which, given the
above functions, seems broken. CASE_BLIND_FILESYSTEM us used by the proxy
and autoindex modules, which I'd guess should be using the above functions,
no?
-Fred
Wilfredo Sanchez, wsanchez@apple.com
Open Source Engineering Lead
Apple Computer, Inc., Core Operating System Group
1 Infinite Loop, Cupertino, CA 94086, 408.974-5174
Re: ap_os_canonical_filename() and friends
Posted by Greg Stein <gs...@lyra.org>.
Simple answer? I'd say that it is simply a mess and nobody really knows the
answer here. (beyond reading the source)
The three functions plus that macro seem *way* overly complex. IMO, please
feel free to use your discretion in cleaning it all up. Certainly can't make
it more obtuse than it is today :-)
Cheers,
-g
On Thu, Jun 08, 2000 at 06:43:16PM -0700, Wilfredo Sánchez wrote:
> I need to (finally) implement case handling for Mac OS X, where you may
> or may not have your document root on an case-insensitive volume. Given
> that OS X will likely ship before using 2.0 is feasible, I'm starting with
> 1.3 and I'll port to 2.0 afterwards.
>
> I have a couple of questions... First, I'm trying to figure out the
> differences between these functions:
>
> ap_os_canonical_filename()
> ap_os_case_canonical_filename()
> ap_os_systemcase_filename()
>
> If ap_os_case_canonical_filename() is supposed to preserve the input
> case, then what is its role?
>
> Say I have a file /FooBar on disk, and I'm looking for a file "/fooBAR".
> What's the result? Let's solve for HFS+ (case insensitive but
> preserving), DOS FAT (case insensitive), and UFS (case sensitive). I think
> I can fill in for ap_os_canonical_filename(), but I don't know about the
> rest:
>
> Input ap_ocf() ap_occf()
> ap_osf()
> HFS+ /fooBAR /FooBar ? ?
> FAT /fooBAR /foobar ? ?
> UFS /fooBAR /fooBAR /fooBAR /fooBAR
>
> Second, we also have a macro CASE_BLIND_FILESYSTEM, which, given the
> above functions, seems broken. CASE_BLIND_FILESYSTEM us used by the proxy
> and autoindex modules, which I'd guess should be using the above functions,
> no?
>
> -Fred
>
> Wilfredo Sanchez, wsanchez@apple.com
> Open Source Engineering Lead
> Apple Computer, Inc., Core Operating System Group
> 1 Infinite Loop, Cupertino, CA 94086, 408.974-5174
--
Greg Stein, http://www.lyra.org/
Re: ap_os_canonical_filename() and friends
Posted by Bill Stoddard <st...@raleigh.ibm.com>.
> I have a couple of questions... First, I'm trying to figure out the
> differences between these functions:
>
> ap_os_canonical_filename()
> ap_os_case_canonical_filename()
> ap_os_systemcase_filename()
>
> If ap_os_case_canonical_filename() is supposed to preserve the input
> case, then what is its role?
Check out the version of ap_os_case_canonical_filename in the os/win32 directory. It is
fairly well commented. Apache on Windows uses the case_canonical_filename functions to
account for the file system not being case sensitive, backslashes used in configuration
directives specifying file paths, meaning of periods (dots) in a file paths, etc. FWIW, I
think the function is misnamed. ap_os_canonical_filename() should preserve case and
ap_os_case_canonical_filename() should fold case.
Bill