Re: [PATCH] pgbench tap tests fail if the path contains a perlspecial character - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: [PATCH] pgbench tap tests fail if the path contains a perlspecial character
Date
Msg-id alpine.DEB.2.21.1901211708440.28235@lancre
Whole thread Raw
In response to Re: [PATCH] pgbench tap tests fail if the path contains a perlspecial character  (Andrew Dunstan <andrew.dunstan@2ndquadrant.com>)
List pgsql-hackers
Hello Andrew,

>> About windows-specific issues, from File::Glob man page:
>>
>> """ On DOSISH systems, backslash is a valid directory separator
>> character. In this case, use of backslash as a quoting character (via
>> GLOB_QUOTE) interferes with the use of backslash as a directory
>> separator. ... """
>>
>> It seems to suggest that quotemeta backslash-on-nearly-everything
>> approach is not appropriate.
>
> File globbing is not the same thing as regex matching. For example, '.'
> is a literal character in a glob pattern but a metacharacter in a regex,
> while ' ' is a literal character in a regex but a globbing metacharacter
> (but see below), and '*' is a metacharacter in both but has different
> meanings. quotemeta is intended for regexes but being used here on an
> expression used for globbing.
>
> Perhaps it would be OK we changed back the glob line to use $prefix
> instead of $qprefix, but kept the use of $qprefix in the later regex.

Yep, possibly. I'll have to test, though.

> To deal with the issue of spaces in file names (not an issue eher ob
> bowerbird), we should consider adding this:
>
>     use File::Glob ':bsd_glob';

I was planning that so that the behavior is the same on all systems.

> This removes the globbing metcharacter nature of the space character,
> although it might have other effects that cause pain. See `perldoc
> File::Glob`

Yep. Thanks for doing my homework:-) I'll test starting with these 
options.

-- 
Fabien.

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCH] pgbench tap tests fail if the path contains a perl special character
Next
From: Fabien COELHO
Date:
Subject: Re: [PATCH] pgbench tap tests fail if the path contains a perlspecial character