<list-paths>
Purpose/Function
Iterates through a ListCache to produce a list of relative paths, absolute paths or URIs.
Attributes
NAME |
TYPE |
DEFAULT VALUE |
DESCRIPTION |
---|---|---|---|
cache |
|
required |
cache returned from an Ls operation |
type |
|
absPath |
choice of absPath, relPath, uriString, or uri; in the latter case, a list of |
dirs |
|
false |
if true, list only directories; default is to list only file entries |
global |
|
false |
assign or declare as global variable |
assign |
|
|
assign list to this variable name |
declare |
|
|
declare list using this variable name |
pattern |
|
|
RegExp pattern to use to filter the entries (optional) |
toFile |
|
|
instead of returning a list, write the result directly to this file |
append |
|
false |
append to the file rather than overwriting |
Examples
<ogrescript> <declare name="cache" /> <ls> <pattern base="file:/Users/arossi/Documents"> <include>*.*</include> </pattern> <return-value assignedName="cache" defaultName="listCache"/> </ls> <list-paths cache="${cache}" declare="paths" type="uriString" pattern=".*.pdf"/> <write-lines path="/tmp/pathList.txt"> <lines>${paths}</lines> </write-lines> </ogrescript> <ogrescript> <declare name="cache" /> <ls> <pattern base="file:/Users/arossi/Documents"> <include>*.*</include> </pattern> <return-value assignedName="cache" defaultName="listCache"/> </ls> <list-paths cache="${cache}" toFile="/tmp/pathList.txt" type="uriString" pattern=".*.pdf"/> </ogrescript>