File: filespec

package info (click to toggle)
libfile-copy-link-perl 0.200-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 180 kB
  • sloc: perl: 601; makefile: 11
file content (29 lines) | stat: -rw-r--r-- 821 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!perl

use strict;
use warnings;
use File::Spec::Link ();
my $VERSION = $File::Spec::Link::VERSION;

for my $link (@ARGV) {
    local $\ = "\n";
    print "$link linked to ",   File::Spec::Link->linked($link);
    print "$link resolves to ", File::Spec::Link->resolve($link);
    print "$link directory ",   File::Spec::Link->chopfile($link);
    print "$link relative to . ",
        File::Spec::Link->relative_to_file(File::Spec->curdir, $link);

    # use Cwd::abs_path()
    print "$link path resolved: ",
        File::Spec::Link->resolve_path($link);

    # tries to use Cwd::abs_path()
    print "$link fully resolved: ",
        File::Spec::Link->full_resolve($link);

    # without using Cwd
    print "$link all resolved: ",
        File::Spec::Link->resolve_all($link);
}

# $Id$