Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chdir "path/"; "subdir".IO.dir drops the first character #5298

Closed
p6rt opened this issue May 5, 2016 · 4 comments
Closed

chdir "path/"; "subdir".IO.dir drops the first character #5298

p6rt opened this issue May 5, 2016 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented May 5, 2016

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

Searchable as RT128073$

@p6rt
Copy link
Author

p6rt commented May 5, 2016

From roam@ringlet.net

Create a directory containing a couple of files​:

mkdir -p some/path/stuff
echo test > some/path/only-a-test.txt

Then try to list the files​:

[roam@​straylight​:pts/22 ~/lang/perl]$ perl6 -e 'use v6.c; chdir "some"; "path".IO.dir.perl.say' ("path/stuff".IO(​:SPEC(IO​::Spec​::Unix),​:CWD("/home/roam/lang/perl/some")), "path/only-a-test.txt".IO(​:SPEC(IO​::Spec​::Unix),​:CWD("/home/roam/lang/perl/some"))).Seq

[roam@​straylight​:pts/22 ~/lang/perl]$ perl6 -e 'use v6.c; chdir "some/"; "path".IO.dir.perl.say'
("ath/stuff".IO(​:SPEC(IO​::Spec​::Unix),​:CWD("/home/roam/lang/perl/some/")), "ath/only-a-test.txt".IO(​:SPEC(IO​::Spec​::Unix),​:CWD("/home/roam/lang/perl/some/"))).Seq

Note the "ath/" prefix in the second case.

Confirmed by perlpilot on IRC.

G'luck,
Peter

--
Peter Pentchev roam@​ringlet.net roam@​FreeBSD.org pp@​storpool.com
PGP key​: http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115 C354 651E EFB0 2527 DF13

@p6rt
Copy link
Author

p6rt commented May 5, 2016

From @AlexDaniel

Also note that it is not only about trailing slashes.

Command​:
perl6 -e 'chdir ‘foo/conf’; ‘.’.IO.dir.say' # that works, obviously

Result​:
("/home/alex/foo/conf/test".IO)

Command​:
perl6 -e 'chdir ‘foo////conf’; ‘.’.IO.dir.say' # that doesn't, but it is 100% valid

Result​:
("/home/alex/foo/conf/t".IO)

See also IRC log​: http://irclog.perlgeek.de/perl6/2016-05-05#i_12438318

@p6rt
Copy link
Author

p6rt commented Jun 22, 2016

From roam@ringlet.net

Fixed by Daniel Green in 86e3e29. Thanks!

G'luck,
Peter

@p6rt
Copy link
Author

p6rt commented Jun 22, 2016

roam@ringlet.net - Status changed from 'new' to 'resolved'

@p6rt p6rt closed this as completed Jun 22, 2016
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant