Resolve file path strings which may include a leading `~`
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib/File/Path
t Initial import Jun 23, 2018
.gitignore
.hgignore
.travis.yml
META6.json
README.md
UNLICENSE Initial import Jun 23, 2018

README.md

File::Path::Resolve

Resolve file path strings which may include a leading ~.

Resolve a path relative to another file.

Synopsis

use File::Path::Resolve;

my $tilde = '~';
File::Path::Resolve.absolute($tilde).perl.say;
# "/home/user".IO

my $conkyrc = '~/.config/conky/conkyrc';
File::Path::Resolve.absolute($conkyrc).perl.say;
# "/home/user/.config/conky/conkyrc".IO

my $script = 'data/script.lua';
File::Path::Resolve.relative($script, $conkyrc).perl.say;
# "/home/user/.config/conky/data/script.lua".IO

$*CWD.say;
# "/home/user/Documents/all".IO

my $dots = '../some/./document';
File::Path::Resolve.absolute($dots).perl.say;
# "/home/user/Documents/some/document".IO

Installation

Dependencies

  • Rakudo Perl 6

Licensing

This is free and unencumbered public domain software. For more information, see http://unlicense.org/ or the accompanying UNLICENSE file.