1 package URI::file::Unix;
3 require URI::file::Base;
4 @ISA=qw(URI::file::Base);
7 use URI::Escape qw(uri_unescape);
11 my($class, $path) = @_;
15 $path =~ s,(/\.)+/,/,g;
16 $path = "./$path" if $path =~ m,^[^:/]+:,,; # look like "scheme:"
21 sub _file_is_absolute {
22 my($class, $path) = @_;
23 return $path =~ m,^/,;
32 my $auth = $uri->authority;
34 if (lc($auth) ne "localhost" && $auth ne "") {
35 $auth = uri_unescape($auth);
36 unless ($class->_file_is_localhost($auth)) {
37 push(@path, "", "", $auth);
42 my @ps = $uri->path_segments;
47 # Unix file/directory names are not allowed to contain '\0' or '/'
49 return undef if /\//; # should we really?
52 return join("/", @path);