Re: Windows paths in glob
- From: Dmitry <mitia2008.remove@xxxxxxxxx>
- Date: Mon, 31 Mar 2008 05:54:54 GMT
"John W. Krahn" <someone@xxxxxxxxxxx> wrote in
cGRHj.9264$9X3.7583@edtnps82:">news:cGRHj.9264$9X3.7583@edtnps82:
Dmitry wrote:
OK, so there's a well-known difficulty with handling Windows-style
paths in glob: it doesn't like backslashes, nor does it like spaces.
One solution to that is to use Unix-style paths:
glob('C:\Documents and Settings\*'); # Doesn't work
glob('C:/Documents\ and\ Settings/*'); # Works
Problem is, the rest of Perl's built-in file-handling functionality
behaves the other way around. For instance, with -d:
-d 'C:\Documents and Settings'; # Works
-d 'C:/Documents\ and\ Settings'; # Doesn't work
Question: is there any way to use the same path string with glob and
with the rest of Perl, without having to convert them back and forth?
perldoc File::DosGlob
perldoc File::Spec
perldoc File::Basename
I tried DosGlob, but when I passed it 'C:\Documents and Settings\*' it bugged out with an
error somewhere in the module...
.
- References:
- Windows paths in glob
- From: Dmitry
- Re: Windows paths in glob
- From: John W. Krahn
- Windows paths in glob
- Prev by Date: Re: printf: zero pad after the decimal a given amount
- Next by Date: Re: Windows paths in glob
- Previous by thread: Re: Windows paths in glob
- Next by thread: Re: Windows paths in glob
- Index(es):
Relevant Pages
|