Return-Path: Delivered-To: apmail-perl-dev-archive@www.apache.org Received: (qmail 46927 invoked from network); 3 Dec 2003 07:07:48 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 3 Dec 2003 07:07:48 -0000 Received: (qmail 5317 invoked by uid 500); 3 Dec 2003 07:07:26 -0000 Delivered-To: apmail-perl-dev-archive@perl.apache.org Received: (qmail 5133 invoked by uid 500); 3 Dec 2003 07:07:25 -0000 Mailing-List: contact dev-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@perl.apache.org Received: (qmail 5119 invoked from network); 3 Dec 2003 07:07:25 -0000 Received: from unknown (HELO mail.logilune.com) (195.154.174.52) by daedalus.apache.org with SMTP; 3 Dec 2003 07:07:25 -0000 Received: from stason.org (localhost.logilune.com [127.0.0.1]) by mail.logilune.com (Postfix) with ESMTP id EE5D67AC44; Wed, 3 Dec 2003 08:07:34 +0100 (CET) Message-ID: <3FCD8CD6.8070706@stason.org> Date: Tue, 02 Dec 2003 23:12:22 -0800 From: Stas Bekman Organization: Hope, Humanized User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030630 X-Accept-Language: en-us, en, he, ru MIME-Version: 1.0 To: Randy Kobes Cc: dev@perl.apache.org Subject: Re: [mp2] ModPerl-Registry redirect test References: <3FC9BDB9.4070504@stason.org> <3FCAD566.9040304@stason.org> <3FCAFC2A.6040806@stason.org> <3FCB8820.6030806@stason.org> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Randy Kobes wrote: [...] >>I won't try to use File::Spec::Unix instead of join '/', >>because one day it may stop loading on non-Unix... > > > That's a good point ... However, using > sub t_catfile_apache { > my $f = canonpath join "/", @_; > return $f unless File::Spec->file_name_is_absolute($f); > return Apache::TestConfig::WIN32 ? > Win32::GetLongPathName($f) : $f; > } > doesn't quite work on Win32 :( (and probably not on Macs, > either), as canonpath flips the '/' back to the native > directory separator ('\' on Win32). What one could do is > then s{[\\:]}{/}g afterwards, but on Win32 one has to take > care of the case that the drive is specified, as > D:/whatever, and not change the ':'. The following is OK: Sorry, I didn't know that. Does this work? sub t_catfile_unix { my $f = File::Spec::Unix->canonpath(join "/", @_); return $f unless File::Spec->file_name_is_absolute($f); return Apache::TestConfig::WIN32 ? Win32::GetLongPathName($f) : $f; } I guess if we do that than your very original patch is just right. We came a full cirle back to where we started (thanks to me ;). So may be just go with: my $f = File::Spec::Unix->catfile(@_); One more thing, I'm not sure about. File::Spec has a clear separation between path and file/dir, the former optionally includes the drive/volume information, the latter do not. Does Win32::GetLongPathName($f) return a path (including drive/volume) or just dir/file? i.e. t_catfile* should deal only with dir/file and not path? Or am I wrong and it's file/path vs. dir? It just makes no difference on Unix, so I'm a bit confused here. __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:stas@stason.org http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org For additional commands, e-mail: dev-help@perl.apache.org