Return-Path: Delivered-To: apmail-httpd-test-dev-archive@www.apache.org Received: (qmail 54188 invoked from network); 19 Feb 2004 07:14:04 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 19 Feb 2004 07:14:04 -0000 Received: (qmail 76057 invoked by uid 500); 19 Feb 2004 07:13:41 -0000 Delivered-To: apmail-httpd-test-dev-archive@httpd.apache.org Received: (qmail 76022 invoked by uid 500); 19 Feb 2004 07:13:41 -0000 Mailing-List: contact test-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: test-dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list test-dev@httpd.apache.org Received: (qmail 76001 invoked from network); 19 Feb 2004 07:13:41 -0000 Received: from unknown (HELO mail.logilune.com) (195.154.174.52) by daedalus.apache.org with SMTP; 19 Feb 2004 07:13:41 -0000 Received: from stason.org (localhost.logilune.com [127.0.0.1]) by mail.logilune.com (Postfix) with ESMTP id 86ED178D3F for ; Thu, 19 Feb 2004 08:13:47 +0100 (CET) Message-ID: <40346229.4090704@stason.org> Date: Wed, 18 Feb 2004 23:13:45 -0800 From: Stas Bekman Organization: Hope, Humanized User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040115 X-Accept-Language: en-us, en, he, ru MIME-Version: 1.0 To: test-dev@httpd.apache.org Subject: Re: Apache::TestMM::generate_script vs. Win32 Paths References: <4032ED0B.6060201@stason.org> <40342ED9.10102@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: > On Wed, 18 Feb 2004, Stas Bekman wrote: > > >>Randy Kobes wrote: >>Thanks for testing, Randy >> >> >>>>+ for my $key (keys %conf_opts) { >>>>+ next unless Apache::TestConfig::conf_opt_is_a_filepath($key); >>>>+ $conf_opts{$key} = Win32::GetShortPathName($conf_opts{$key}); > > [ ... ] > >>ay, that's so incredibly >here>. there is no a core function that will take any >>given path and return a usable path? >> >>do you need to run this transform only if /\s/? What about >>long names (>8.3), don't they have short names too? > > > Yes, they do have short names. And it is a pain ... I should > have expanded - Win32::GetShortPathName() will return a > usable path if the file/directory physically exists - if a > conversion to 8.3 components is needed, then that is done, > otherwise, the original is returned. However, at this stage > I don't think (?) we can assume the file/directory yet > exists, at least for all the ones that this is being applied > to, so calling Win32::GetShortPathName on them will cause > the given values to be lost if they don't yet exist. Why not? All these arguments should be existing. (I think sans -libmodperl which may not exist) > So, actually, I take that back about applying > Win32::GetSHortPathName($f) only if $f =~ /\s/, as that > was a red herring - doing it like > > for my $key (keys %conf_opts) { > next unless Apache::TestConfig::conf_opt_is_a_filepath($key); > next unless -e $conf_opts{$key}; > $conf_opts{$key} = Win32::GetShortPathName($conf_opts{$key}); > > should be OK when the entry (physically) exists, whether > that's a short or long name, and if it doesn't exist, > presumably it will either be created or tested for later. > One might have to do a Win32::GetShortPathName() if such an > entry does get created later on, but we could wait and see. cool. In any case, please take the ownership of the patch I posted and once you guys are happy with it, please go ahead and commit it. Otherwise it's a broken phone. Thanks. >>For god's sake, can someone patch File::Spec to handle >>that win32 ridicule? Just think how much time every >>project wastes to deal with the same issues, again and >>again if they need to work with win32... not talking about >>making the source code cluttered with unneeded noise. >>that's just disgusting. >> >>Shouldn't canonfile() know how to deal with this >>GetShortPathName thingy? > > I guess it could, but that would involve somewhat of a > departure from the philosophy of File::Spec. File::Spec can > handle any combination of files/directories, whether or not > they actually exist on the system, whereas things like > Win32::GetShortPathName() only makes sense for > files/directories that physically exist. So incorporating > the short path name stuff in File::Spec would lead to a > branch in what gets returned, depending on whether or not > the entry physically exists. before you implement this ;) what would you expect canonfile to do under win32? is GetShortPathName is the thing you'd expect? As it will always work? BTW, does it make sure that two similar long names will never collapse into one short name? Meaning that the short name is not deterministic but depends on other the existence of other files with similar names? If it was deterministic, you could go and create the non-existing file, get its short name and delete the file, no? __________________________________________________________________ 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