# class IO::Spec::Cygwin

Platform specific operations on file and directory paths for Cygwin

## method join

Defined as:

Same as IO::Spec::Win32.join, except replaces backslashes with slashes in the final result.

## method rel2abs

Defined as:

Same as IO::Spec::Win32.rel2abs, except replaces backslashes with slashes in the final result.

## method split

Defined as:

Same as IO::Spec::Win32.split, except replaces backslashes with slashes in all the values of the final result.

## method splitpath

Defined as:

Same as IO::Spec::Win32.splitpath, except replaces backslashes with slashes in all the values of the final result.

## method tmpdir

Defined as:

Attempts to locate a system's temporary directory by checking several typical directories and environmental variables. Uses current directory if no suitable directories are found.

# Routines supplied by class IO::Spec::Unix

IO::Spec::Cygwin inherits from class IO::Spec::Unix, which provides the following methods:

## (IO::Spec::Unix) method abs2rel

Defined as:

Returns a string that represents $path, but relative to $base path. Both $path and $base may be relative paths $bar defaults to $*CWD

## (IO::Spec::Unix) method basename

Defined as:

Takes a path as a string and returns a possibly-empty portion after the last slash:

## (IO::Spec::Unix) method canonpath

Defined as:

Returns a string that is a canonical representation of $path. If :$parent is set to true, will also clean up references to parent directories. NOTE: the routine does not access the filesystem, so no symlinks are followed.

## (IO::Spec::Unix) method catdir

Defined as:

Concatenates multiple path fragments and returns the canonical representation of the resultant path as a string. The @parts are Str objects and are allowed to contain path separators.

## (IO::Spec::Unix) method catfile

Alias for catdir.

## (IO::Spec::Unix) method catpath

Defined as:

Takes two path fragments and concatenates them, adding or removing a path separator, if necessary. The first argument is ignored (it exists to maintain consistent interface with other IO::Spec types for systems that have volumes).

## (IO::Spec::Unix) method curdir

Defined as:

Returns a string representing the current directory:

## (IO::Spec::Unix) method curupdir

Defined as:

Returns a none Junction of strings representing the current directory and the "one directory up":

## (IO::Spec::Unix) method devnull

Defined as:

Returns the string "/dev/null" representing the "Null device":

## (IO::Spec::Unix) method dir-sep

Defined as:

Returns the string "/" representing canonical directory separator character.

## (IO::Spec::Unix) method extension

NOTE: Most users would want to use the higher-level routine IO::Path.extension instead of this lower-level version.

Defined as:

Takes a string representing a base name and returns the characters after the last dot ("."), or empty string if no dots are present. The routine makes no attempt to detect path separators and will return everything after the last dot.

Defined as:

## (IO::Spec::Unix) method rootdir

Defined as:

Returns string '/', representing root directory.

Defined as:

## (IO::Spec::Unix) method splitpath

Defined as:

Splits the given $path into a list of 3 strings: volume, dirname, and file. The volume is always an empty string, returned for API compatibility with other IO::Spec types. If :$nofile named argument is set to True, the content of the file string is undefined and should be ignored; this is a means to get a performance boost, as implementations may use faster code path when file is not needed.

## (IO::Spec::Unix) method tmpdir

Defined as:

Attempts to locate a system's temporary directory by checking several typical directories and environmental variables. Uses current directory if no suitable directories are found.

## (IO::Spec::Unix) method updir

Defined as:

Returns a string representing the directory one up from current:

# Routines supplied by class Any

IO::Spec::Cygwin inherits from class Any, which provides the following methods:

Defined as:

Usage:

## (Any) method deepmap

Defined as:

deepmap will apply &block to each element and return a new List with the return values of &block, unless the element does the Iterable role. For those elements deepmap will descend recursively into the sublist.

## (Any) method duckmap

Defined as:

duckmap will apply &block on each element and return a new list with defined return values of the block. For undefined return values, duckmap will try to descend into the element if that element implements Iterable.

## (Any) method nodemap

Defined as:

nodemap will apply &block to each element and return a new List with the return values of &block. In contrast to deepmap it will not descend recursively into sublists if it finds elements which does the Iterable role.

The examples above would have produced the exact same results if we had used map instead of nodemap. The difference between the two lies in the fact that map flattens out slips while nodemap doesn't.

## (Any) method flat

Defined as:

Interprets the invocant as a list, flattens non-containerized Iterables into a flat list, and returns that list. Keep in mind Map and Hash types are Iterable and so will be flattened into lists of pairs.

Note that Arrays containerize their elements by default, and so flat will not flatten them. You can use hyper method call to call .List method on all the inner Iterables and so de-containerize them, so that flat can flatten them:

For more fine-tuned options, see deepmap, duckmap, and signature destructuring

## (Any) method eager

Defined as:

Interprets the invocant as a list, evaluates it eagerly, and returns that list.

## (Any) method elems

Defined as:

Interprets the invocant as a list, and returns the number of elements in the list.

## (Any) method end

Interprets the invocant as a list, and returns the last index of that list.

## (Any) method pairup

Defined as:

Interprets the invocant as a list, and constructs a list of pairs from it, in the same way that assignment to a Hash does. That is, it takes two consecutive elements and constructs a pair from them, unless the item in the key position already is a pair (in which case the pair is passed is passed through, and the next list item, if any, is considered to be a key again).

Defined as:

## (Any) method Array

Defined as:

Coerce the invocant to Array.

## (Any) method List

Defined as:

Coerce the invocant to List.

## (Any) method Hash

Defined as:

Coerce the invocant to Hash.

## (Any) method hash

Defined as:

Coerce the invocant to Hash.

## (Any) method Slip

Defined as:

Coerce the invocant to Slip.

## (Any) method Map

Defined as:

Coerce the invocant to Map.

## (Any) method Bag

Defined as:

Coerce the invocant to Bag, whereby Positionals are treated as lists of values.

## (Any) method BagHash

Defined as:

Coerce the invocant to BagHash, whereby Positionals are treated as lists of values.

## (Any) method Set

Defined as:

Coerce the invocant to Set, whereby Positionals are treated as lists of values.

## (Any) method SetHash

Defined as:

Coerce the invocant to SetHash, whereby Positionals are treated as lists of values.

## (Any) method Mix

Defined as:

Coerce the invocant to Mix, whereby Positionals are treated as lists of values.

## (Any) method MixHash

Defined as:

Coerce the invocant to MixHash, whereby Positionals are treated as lists of values.

## (Any) method Supply

Defined as:

Coerce the invocant first to a List and then to a Supply.

## (Any) method min

Defined As:

Coerces to Iterable and returns the numerically smallest element. If a Callable positional argument is provided it is called with each element and its smallest return values is returned.

## (Any) method max

Defined As:

Coerces to Iterable and returns the numerically biggest element. If a Callable positional argument is provided it is called with each element and its biggest return values is returned.

## (Any) method minmax

Defined As:

Returns a list containing the smallest and the biggest element. If a Callable positional argument is provided each element is filtered and then numerically compared.

## (Any) method minpairs

Defined As:

Calls .pairs and returns a Seq with all of the Pairs with minimum values, as judged by the cmp operator:

## (Any) method maxpairs

Defined As:

Calls .pairs and returns a Seq with all of the Pairs with maximum values, as judged by the cmp operator:

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

## (Any) method unique

Defined As:

Treats the Any as a 1-item list and uses List.unique on it.

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

Defined As:

TODO

# Routines supplied by class Mu

IO::Spec::Cygwin inherits from class Mu, which provides the following methods:

## (Mu) routine defined

Returns False on the type object, and True otherwise.

Very few types (like Failure) override defined to return False even for instances:

## (Mu) routine isa

Returns True if the invocant is an instance of class $type, a subset type or a derived class (through inheritance) of $type.

A more idiomatic way to do this is to use the smartmatch operator ~~ instead.

## (Mu) method ACCEPTS

ACCEPTS is the method that smart matching with the infix ~~ operator and given/when invokes on the right-hand side (the matcher).

The Mu:U multi performs a type check. Returns True if \$other conforms to the invocant (which is always a type object or failure).

Note that there is no multi for defined invocants; this is to allow autothreading of junctions, which happens as a fallback mechanism when no direct candidate is available to dispatch to.

## (Mu) method WHICH

Returns an object of type ObjAt which uniquely identifies the object. Value types override this method which makes sure that two equivalent objects return the same return value from WHICH.

## (Mu) method WHERE

Returns an Int representing the memory address of the object.

## (Mu) method WHY

Returns the attached Pod value. For instance,

prints

See the documentation specification for details about attaching Pod to variables, classes, functions, methods, etc.

## (Mu) trait is export

Marks a type as being exported, that is, available to external users.

A user of a module or class automatically gets all the symbols imported that are marked as is export.

See Exporting and Selective Importing Modules for more details.

## (Mu) method return

The method return will stop execution of a subroutine or method, run all relevant phasers and provide invocant as a return value to the caller. If a return type constraint is provided it will be checked unless the return value is Nil. A control exception is raised and can be caught with CONTROL.

## (Mu) method return-rw

Same as method return except that return-rw returns a writable container to the invocant (see more details here: return-rw).

## (Mu) method emit

Emits the invocant into the enclosing supply or react block.

## (Mu) method take

Returns the invocant in the enclosing gather block.

## (Mu) routine take

Takes the given item and passes it to the enclosing gather block.

## (Mu) routine take-rw

Returns the given item to the enclosing gather block, without introducing a new container.

## (Mu) method so

Returns a Bool value representing the logical non-negation of an expression. One can use this method similarly to the English sentence: "If that is so, then do this thing". For instance,

## (Mu) method not

Returns a Bool value representing the logical negation of an expression. Thus it is the opposite of so.

Since there is also a prefix version of not, the above code reads better like so: