File: pathname2.rb [pathname2-1.7.3 Documentation]

Last Modified
  2015-08-12 09:21:44 +0000
Requires
  - facade
  - fileutils
  - pp
  - ffi
  - uri
  - find

## Description

## Synopsis

Pathname represents a path name on a filesystem. A Pathname can be relative or absolute. It does not matter whether the path exists or not.

All functionality from File, FileTest, and Dir is included, using a facade pattern.

This class works on both Unix and Windows, including UNC path names. Note that forward slashes are converted to backslashes on Windows systems.

## Usage

require "pathname2"

# Unix path1 = Pathname.new("/foo/bar/baz") path2 = Pathname.new("../zap")

path1 + path2 # "/foo/bar/zap" path1.dirname # "/foo/bar"

# Windows path1 = Pathname.new("C:\foo\bar\baz") path2 = Pathname.new("..\zap")

path1 + path2 # "C:\foo\bar\zap" path1.exists? # Does the path exist?