Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.9k stars 540 forks source link

Bug (?) in module File::Find #929

Closed p5pRT closed 20 years ago

p5pRT commented 24 years ago

Migrated from rt.perl.org#1872 (status was 'resolved')

Searchable as RT1872$

p5pRT commented 24 years ago

From Peter.Schuringa@NL2.vdogrp.de

There seems to be a glitch in the module "File​::Find". Whenever this module constructs a file name (which can be accessed via File​::Find​::name) it uses a forward slash ("/") even if the perl-script is running on a WinNT box. This is very annoying as I am writing perl-code that must run properly on both WinNT as UNIX boxes. Modifying the line below will solve this problem​:   $name = "$dir/$_";

With kind regards\, Peter Schuringa VDO-CC\, Eindhoven\, The Netherlands

p5pRT commented 24 years ago

From @tamias

On Thu\, Dec 09\, 1999 at 05​:41​:29PM +0100\, Schuringa\, Peter wrote​:

Ls\,

There seems to be a glitch in the module "File​::Find". Whenever this module constructs a file name (which can be accessed via File​::Find​::name) it uses a forward slash ("/") even if the perl-script is running on a WinNT box. This is very annoying as I am writing perl-code that must run properly on both WinNT as UNIX boxes. Modifying the line below will solve this problem​: $name = "$dir/$_";

WinNT should not have any problem using filenames containing forward slashes as directory separators.

Have you actually encountered any problems using the module on WinNT?

Ronald

p5pRT commented 24 years ago

From [Unknown Contact. See original ticket]

From​: Ronald J Kimball [mailto​:rjk@​linguist.dartmouth.edu]

WinNT should not have any problem using filenames containing forward slashes as directory separators.

Have you actually encountered any problems using the module on WinNT?

It's not me with the problem\, but system("dir $file") is a trivial example of something that requires backslashes. Basically\, system calls work OK\, but the shell (as used by system\, qx\, pipes\, exec) doesn't like forward slashes.

But use of the shell isn't portable\, so that may not be relevant to the original poster.

Logging filenames to a report is another area where forward slashes "don't work" - in the sense that reports should use the system's "canonical" filename format. I'd hate to try to explain to a customer that slashes are OK - especially if slashes and backslashes are mixed...

p5pRT commented 24 years ago

From [Unknown Contact. See original ticket]

Ronald J Kimball \rjk@​linguist\.dartmouth\.edu writes​:

On Thu\, Dec 09\, 1999 at 05​:41​:29PM +0100\, Schuringa\, Peter wrote​:

Ls\,

There seems to be a glitch in the module "File​::Find". Whenever this module constructs a file name (which can be accessed via File​::Find​::name) it uses a forward slash ("/") even if the perl-script is running on a WinNT box. This is very annoying as I am writing perl-code that must run properly on both WinNT as UNIX boxes. Modifying the line below will solve this problem​: $name = "$dir/$_";

WinNT should not have any problem using filenames containing forward slashes as directory separators.

The OS calls don't mind. But passing them as strings via cmd.exe (e.g. via system()) does not work.

Have you actually encountered any problems using the module on WinNT?

Ronald -- Nick Ing-Simmons