The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

relpath - Return the relative pathname

VERSION

version 0.02

SYNOPSIS

Usage:

 % relpath [OPTIONS] <filename> ...

Examples:

 % relpath /etc/passwd /home/steven/f1 subdir/f2
 ../../etc/passwd
 f1
 subdir/f2

DESCRIPTION

This program complements the Unix command realpath. realpath converts relative pathnames to absolute ones, while relpath does the opposite.

The actual routine used is File::Spec's abs2rel() function.

By default, will check first that the filenames exist, unless --nocheck (-C) is specified.

OPTIONS

  • --[no]check, -c

    Whether to check that file exists. Default is on.

  • -C

    Alias for --nocheck.

EXIT CODES

0 on success.

1 on some error, e.g. some filenames are not found (and --check is on).

99 on command-line options error.

TODO

Option to set pwd.

Actually check the existence of files.

FAQ

SEE ALSO

realpath

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/App-relpath.

SOURCE

Source repository is at https://github.com/sharyanto/perl-App-relpath.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=App-relpath

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHOR

Steven Haryanto <stevenharyanto@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Steven Haryanto.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.