On 11/06/07, jerry gay <[EMAIL PROTECTED]> wrote:
On 6/11/07, Paul Cochrane <[EMAIL PROTECTED]> wrote:
> On 09/03/07, chromatic <[EMAIL PROTECTED]> wrote:
> > On Friday 09 March 2007 05:00, Ron Blaschke wrote:
> >
> > > Attached patch replaces the backslashes with slashes on Windows.
> >
> > Would using File::Spec be less fragile?
>
> I've attached a patch which uses File::Spec instead of replacing one
> set of slashes with another.  Comments welcome!  :-)
>
good idea.

instead of breaking up the path and reconstructing it separately
(since the individual components of the path aren't used anywhere
else,) how about using 'canonpath' to clean up the path in one step.
something like:

                if ( $result =~ m{(.*) - (.*)} ) {
                    my $file = canonpath $1;
                    my $attribute = $2;

                    # and add to the results hash
                    $results{$file} = $attribute;
                }

Done in the attached patch.  Does this patch work for you jerry?  I
can't test it on Windows unfortunately, but it works on Linux x86.

Paul

Attachment: file_metadata.patch
Description: Binary data

Reply via email to