Skip Menu |

This queue is for tickets about the PathTools CPAN distribution.

Report information
The Basics
Id: 98260
Status: new
Priority: 0/
Queue: PathTools

Owner: Nobody in particular
Requestors: mrudat [...]

Bug Information
Severity: Normal
Broken in: 3.47
Fixed in: (no value)

Subject: inconsistent behaviour for missing path
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
Message-ID: <rt-4.0.18-9607-1408724165-1214.0-0-0 [...]>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 1291
Download (untitled) / with headers
text/plain 1.2k
On linux (ubuntu 14.04 perl v5.18.2 Cwd 3.40): $ perl -e "use Cwd qw(abs_path); use Data::Dumper; print Dumper abs_path('/i/see/no/path/here');" $VAR1 = undef; On win32 (win 7 pro x64, ActiveState perl v5.16.3 Cwd 3.47 (installed via CPAN)): Show quoted text
>perl -e "use Cwd qw(abs_path); use Data::Dumper; print Dumper abs_path('/i/see/no/path/here');"
/i/see/no/path/here: No such file or directory at -e line 1. In theory, for all platforms, abs_path on a missing file should return one of: a) undef b) an exception c) the pathname if it did exist ie. the same as File::Spec::Functions::rel2abs($path,getcwd()) hmm... on the above linux box: $ mkdir /tmp/foo $ cd /tmp/foo $ rmdir /tmp/foo $ perl -e "use Cwd; use Data::Dumper; print Dumper getcwd();" $VAR1 = undef; $ perl -e "use Cwd; use Data::Dumper; print Dumper cwd();" /bin/pwd: couldn't find directory entry in ā€˜..ā€™ with matching i-node $VAR1 = ''; My preference would be for returning undef in all cases when the candidate path doesn't exist; though knowing the value of the absolute path that would result from creating the candidate file is useful too. I've been looking at this mostly because App::perlmv doesn't build on windows, as far as I can tell, partially because of the difference in behaviour of abs_path between platforms.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to