Changeset 12294 in project


Ignore:
Timestamp:
10/29/08 03:57:43 (13 years ago)
Author:
Ivan Raikov
Message:

Added documentation for file path operations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/filepath

    r12293 r12294  
    117117<procedure>filepath:split-drive</procedure>
    118118
    119 <procedure>filepath:join-drive</procedure>
    120 
    121 <procedure>filepath:take-drive</procedure>
    122 
    123 <procedure>filepath:has-drive?</procedure>
    124 
    125 <procedure>filepath:drop-drive</procedure>
    126 
    127 <procedure>filepath:is-drive?</procedure>
     119Splits a path into a Windows drive and a path. When in POSIX mode,
     120{{/}} is treated as a drive.
     121
     122<procedure>(filepath:join-drive DRIVE PATH) => PATH</procedure>
     123
     124Joins a drive and the rest of the path.
     125
     126<procedure>(filepath:take-drive PATH) => DRIVE</procedure>
     127
     128Returns the drive of a path.
     129
     130<procedure>(filepath:has-drive? PATH) => BOOL</procedure>
     131
     132Returns whether the given path has a drive.
     133
     134<procedure>(filepath:drop-drive PATH) => PATH</procedure>
     135
     136Removes the drive from the given path.
     137
     138<procedure>(filepath:is-drive? STRING) => BOOL</procedure>
     139
     140Returns true if the given string is a drive specification.
    128141
    129142==== Operations on a file path
    130143
    131 <procedure>filepath:split-file-name</procedure>
    132 
    133 <procedure>filepath:take-file-name</procedure>
    134 
    135 <procedure>filepath:replace-file-name</procedure>
    136 
    137 <procedure>filepath:drop-file-name</procedure>
    138 
    139 <procedure>filepath:take-base-name</procedure>
    140 
    141 <procedure>filepath:replace-base-name</procedure>
    142 
    143 <procedure>filepath:take-directory</procedure>
    144 
    145 <procedure>filepath:replace-directory</procedure>
    146 
    147 <procedure>filepath:combine</procedure>
    148 
    149 <procedure>filepath:split-path</procedure>
    150 
    151 <procedure>filepath:join-path</procedure>
     144<procedure>(filepath:split-file-name PATH) => (DIR FILE)</procedure>
     145
     146Splits a path into directory and file.
     147
     148<procedure>(filepath:take-file-name PATH) => FILE</procedure>
     149
     150Returns the filename component of a path.
     151
     152<procedure>(filepath:replace-file-name PATH FILE) => PATH</procedure>
     153
     154Replaces the filename component of a path with the given one.
     155
     156<procedure>(filepath:drop-file-name PATH) => PATH</procedure>
     157
     158Removes the filename component of a path.
     159
     160<procedure>(filepath:take-base-name PATH) => STRING</procedure>
     161
     162Returns the base file name (no extension) of a path.
     163
     164<procedure>(filepath:replace-base-name PATH BASE) => PATH</procedure>
     165
     166Replaces the base file name of a path with the given one.
     167
     168<procedure>(filepath:take-directory PATH) => DIR</procedure>
     169
     170Returns the directory component of a path.
     171
     172<procedure>(filepath:replace-directory PATH DIR) => PATH</procedure>
     173
     174Replaces the directory component of a path with the given one.
     175
     176<procedure>(filepath:combine PATH1 PATH2) => PATH</procedure>
     177
     178Combines two paths. If the second path is absolute, then it returns the second.
     179
     180<procedure>(filepath:split-path PATH) => LIST</procedure>
     181
     182Splits a path by the directory separator.
     183
     184<procedure>(filepath:join-path LIST) => PATH</procedure>
     185
     186Joins path elements back together.
    152187
    153188<procedure>filepath:split-directories</procedure>
     189
     190As {{split-path}}, but does not add trailing separators to each element.
    154191
    155192==== Trailing Separators
Note: See TracChangeset for help on using the changeset viewer.