Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Path-Class CPAN distribution.

Maintainer(s)' notes

I prefer that bugs & patches are filed on GitHub rather than on RT: https://github.com/kenahoo/Path-Class/issues. Thanks.

Report information
The Basics
Id: 60077
Status: new
Priority: 0/
Queue: Path-Class

People
Owner: Nobody in particular
Requestors: BRIANPUGH [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.17
Fixed in: (no value)



Subject: dir_list not including volume (fails round trip)
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1280945162-3226-27"
Content-Length: 0
Content-Type: text/plain; charset="UTF-8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 464
Download (untitled) / with headers
text/plain 464b
It seems that dir_list is returning a list where the first element is empty string where is should be the drive letter on win32 systems. I have had a chance to test the behavior on Linux system. I attached a test script that shows the issue. Current work around: my $path = dir( 'c:\windows' ); my @dir_list = $path->dir_list(); my $new_path = dir( @dir_list ); $new_path = dir( $path->volume(), @dir_list) if $path->volume(); $new_path = $new_path->cleanup();
Subject: test_path_class_dir_list.pl
MIME-Version: 1.0
Content-Type: text/x-perl; name="test_path_class_dir_list.pl"
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline; filename="test_path_class_dir_list.pl"
Content-Transfer-Encoding: binary
Content-Length: 919
use strict; use warnings; use Path::Class; # dir(), file() use Data::Dumper; my @test_dirs = qw{ c:\windows d:\windows }; print "=== Test round trip ===\n"; foreach ( @test_dirs ) { round_trip_test($_) } print "=== Test adding volume ===\n"; foreach ( @test_dirs ) { add_volume_test($_) } sub round_trip_test { my $dir = shift; my $test_dir = dir( $dir ); print "Test dir: '$test_dir'\n"; my @dir_list = $test_dir->dir_list(); print "dir list: " . Dumper(\@dir_list); my $reconst_test_dir = dir( @dir_list ); print "Reconst test dir: '$reconst_test_dir'\n\n"; } sub add_volume_test { my $dir = shift; my $test_dir = dir( $dir ); print "Test dir: '$test_dir'\n"; my @dir_list = $test_dir->dir_list(); my $reconst_test_dir = dir( $test_dir->volume(), @dir_list ); print "Reconst test dir: '$reconst_test_dir'\n\n"; }


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

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.