diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-10-10 11:46:30 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-10-10 11:46:30 -0700 |
commit | 620a3aa8354070d29e4fd32756eff25cb5ef378f (patch) | |
tree | eeaa828a050454a3128fa6b01e83fa4004f03eb0 /txr.1 | |
parent | 1b6d4d6e56607752b5ba5b465f943a3270c9f311 (diff) | |
download | txr-620a3aa8354070d29e4fd32756eff25cb5ef378f.tar.gz txr-620a3aa8354070d29e4fd32756eff25cb5ef378f.tar.bz2 txr-620a3aa8354070d29e4fd32756eff25cb5ef378f.zip |
New path-equal function.
* lisplib.c (copy_file_set_entries): Add path-equal to autoload symbols.
* stdlib/copy-file.tl (path-equal): New function.
* tests/018/path-equal.tl: New file.
* txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 68 |
1 files changed, 68 insertions, 0 deletions
@@ -58302,6 +58302,74 @@ there are no files, then read from standard input: @(end) .brev +.coNP Function @ path-equal +.synb +.mets (path-equal < left-path << right-path ) +.syne +.desc +The +.code path-equal +function determines whether the two paths +.meta left-path +and +.meta right-path +are equal under a certain definition of equivalence, whose requirements are given below. +The function returns +.code t +if the paths are equal, otherwise +.codn nil . + +If +.meta left-path +and +.meta right-path +are strings which are identical under the +.code equal +function, then they are considered equal paths. + +Otherwise, the two paths are equal if the relative path from +.meta left-path +to +.meta right-path +is +.str . +(dot), as would be determined by the +.code path-rel +function, if it were applied to +.meta left-path +and +.meta right-path +as its arguments. If +.code path-rel +would return the dot path, then the two paths are equal. If +.code path-rel +would return any other value, or throw an exception, then the paths are unequal. + +.TP* Examples: + +.verb + ;; simple case + (path-equal "a" "a") -> t + (path-equal "a" "b") -> nil + + ;; trailing slashes don't matter + (path-equal "a" "a/") -> t + (path-equal "a/" "a/") -> t + + ;; .. components resolved: + (path-equal "a/b/../c" "a/c") -> t + + ;; . components resolved: + (path-equal "a" "a/././.") -> t + (path-equal "a/." "a/././.") -> t + + ;; (On Microsoft Windows) + ;; different drive: + (path-equal "c:/a" "d:/b/../a") -> nil + ;; same drive: + (path-equal "c:/a" "c:/b/../a") -> t +.brev + .coNP Functions @ abs-path-p and @ portable-abs-path-p .synb .mets (abs-path-p << path ) |