backstop-1.3.0.352: Backstop a target directory by source directories

Utils

Synopsis

# Documentation

pairs :: [a] -> [(a, a)] Source #

Given a list [a], pairs returns the list of all pairs [(a,a)] of [a] progressing from the head to tail of [a]. For example,

pairs [x1,x2,x3,x4]
== [(x1,x2),(x1,x3),(x1,x4),(x2,x3),(x2,x4),(x3,x4)]

Note that

pairs []     == []
pairs (x:[]) == []

unpairs :: Eq a => [(a, a)] -> [a] Source #

For length l /= 1,

(unpairs . pairs) l == l

is True.

Number of elements    Number of pairs
------------------    ---------------
0 => 0
1 => 0
2 => 1
3 => 3
4 => 6
5 => 10
e => p = e(e-1)/2, e >= 0

root = [pathSeparator]

dot = "."

dotdot = ".."

reduceFilePath returns a pathname that is reduced to canonical form equivalent to that of ksh(1), that is, symbolic link names are treated literally when finding the directory name. See cd -L of ksh(1). Specifically, extraneous separators ("/"), dot ("."), and double-dot ("..") directories are removed.

Given a pathname wd representing a workng directory and two pathnames p1 and p2, absoluteLink returns the reduced (reduceFilePath) and absolute path to p2 to which p1 could point as a symbolic link.

If wd is not an absolute path, it is assumed to be a relative path that is relative to the root directory of the file system tree and is made an absolute path.

Given a pathname wd representing a workng directory and two pathnames p1 and p2, relativeLink returns the reduced (reduceFilePath) and relative path from p1 to p2 to which p1 could point as a symbolic link. Thus, p1 must not be the root ("/"), dot ("."), nor double-dot ("..") directories but of the form "/SomePath/SymLink"

If wd is not an absolute path, it is assumed to be a relative path that is relative to the root directory of the file system tree and is made an absolute path.

compElems :: Eq a => [a] -> [a] -> ([a], [a], [a]) Source #

compElems compares elements of two lists and returns the list of elements that are in both lists, unique to the first list, and uniqued to the second list. Duplicates are nubed.

subdirectories returns true if either the absolute pathname p1 or the absolute pathname p2 is a sub-directory or sub-path of the other.

subdirectory returns true if the absolute pathname p1 is a subdirectory of the absolute pathname p2 as in

p1 subdirectory p2

otherwise false.

aDirectory returns true if p is not a symbolic link and is a directory, otherwise false.

aSymbolicLink returns true if p is a symbolic link, otherwise false.

anObject returns true if p is an object in the filesystem, otherwise false. Symbolic links are not deferenced.

Put a string or page it if the environmental variable PAGER is set.