fileset-017
The pipeline
<p:declare-step xmlns:cx="http://xmlcalabash.com/ns/extensions"
xmlns:p="http://www.w3.org/ns/xproc"
xmlns:t="http://xproc.org/ns/testsuite/3.0" name="main" version="3.0">
<p:import href="https://xmlcalabash.com/ext/library/fileset.xpl"/>
<p:output port="result" sequence="true"/>
<cx:fileset path="../testfolder/attr">
<p:with-input>
<fileset>
<readable/>
</fileset>
</p:with-input>
</cx:fileset>
</p:declare-step>
Result
<c:directory xmlns:c="http://www.w3.org/ns/xproc-step"
xmlns:t="http://xproc.org/ns/testsuite/3.0"
xml:base="file:///woodpecker/src/codeberg.org/xmlcalabash/xmlcalabash3/tests/extra-suite/test-suite/testfolder/attr/" name="attr">
<c:file xml:base="unwritable.txt"
name="unwritable.txt"/>
<c:file xml:base="executable.sh"
name="executable.sh"/>
<c:file xml:base="readable.txt" name="readable.txt"/>
<c:file xml:base="writable.txt" name="writable.txt"/>
</c:directory>
Filesystem environment
This configuration cannot be achieved on Windows.
Directory | Perm | Filename | Last-modified | Size | Encoding | Contents (abbreviated) |
---|---|---|---|---|---|---|
attr | drwx | |||||
.rwx | executable.sh |
| 31 |
| #!/bin/sh… | |
.rwx | readable.txt |
| 8 |
| readable | |
.-wx | unreadable.txt |
| 10 |
| unreadable | |
.r-x | unwritable.txt |
| 10 |
| unwritable | |
.rwx | writable.txt |
| 8 |
| writable | |
compare/a | drwx | |||||
.rwx | four.txt | 2025-01-01T01:01:00Z | 4 |
| four | |
.rwx | one.txt | 2025-01-01T01:01:00Z | 3 |
| one | |
.rwx | three.txt | 2025-01-01T01:01:00Z | 5 |
| three | |
.rwx | two.txt | 2025-01-01T01:01:00Z | 3 |
| two | |
compare/b | drwx | |||||
.rwx | one.txt | 2025-01-01T01:01:00Z | 3 |
| one | |
.rwx | three.txt | 2025-01-01T01:01:00Z | 5 |
| THREE | |
.rwx | two.txt | 2025-02-02T01:01:00Z | 3 |
| two | |
content-types | drwx | |||||
.rwx | doc.txt |
| 0 |
|
| |
.rwx | doc.xml |
| 0 |
|
| |
.rwx | image.svg |
| 0 |
|
| |
.rwx | pipe.xpl |
| 0 |
|
| |
dates/jan | drwx | |||||
.rwx | one.txt | 2025-01-01T01:01:00Z | 3 |
| one | |
.rwx | three.txt | 2025-01-01T01:01:00Z | 9 |
| TWO three | |
.rwx | two.txt | 2025-01-01T01:01:00Z | 7 |
| ONE two | |
dates/jun | drwx | |||||
.rwx | one.txt | 2025-06-01T06:01:00Z | 3 |
| one | |
.rwx | three.txt | 2025-06-01T06:01:10Z | 9 |
| TWO three | |
.rwx | two.txt | 2025-06-01T06:01:05Z | 7 |
| ONE two | |
encoding | drwx | |||||
.rwx | iso-8859-1.txt |
| 24 | ISO-8859-1 | Copyright © “some date”. | |
.rwx | utf-8.txt |
| 24 |
| Copyright © “some date”. | |
.rwx | utf-8.txt |
| 24 |
| Copyright © “some date”. | |
glob/a | drwx | |||||
.rwx | a.txt |
| 0 |
|
| |
.rwx | b.txt |
| 0 |
|
| |
.rwx | c.txt |
| 0 |
|
| |
.rwx | d.txt |
| 0 |
|
| |
glob/b | drwx | |||||
.rwx | a.out |
| 0 |
|
| |
.rwx | b.other |
| 0 |
|
| |
.rwx | c.out |
| 0 |
|
| |
hier | drwx | |||||
.rwx | one/.git/something |
| 9 |
| something | |
.rwx | one/a.txt |
| 0 |
|
| |
.rwx | one/b.txt |
| 0 |
|
| |
.rwx | one/backup~ |
| 0 |
|
| |
.rwx | one/c.txt |
| 0 |
|
| |
.rwx | one/d.txt |
| 0 |
|
| |
.rwx | one/two/a.txt |
| 0 |
|
| |
.rwx | one/two/b.txt |
| 0 |
|
| |
.rwx | one/two/c.txt |
| 0 |
|
| |
.rwx | one/two/three/a.txt |
| 0 |
|
| |
.rwx | one/two/three/b.txt |
| 0 |
|
| |
.rwx | one/two/three/c.txt |
| 0 |
|
| |
.rwx | one/two/three/d.other |
| 0 |
|
| |
hier/one | drwx | |||||
.rwx | .git/something |
| 9 |
| something | |
.rwx | a.txt |
| 0 |
|
| |
.rwx | b.txt |
| 0 |
|
| |
.rwx | backup~ |
| 0 |
|
| |
.rwx | c.txt |
| 0 |
|
| |
.rwx | d.txt |
| 0 |
|
| |
.rwx | two/a.txt |
| 0 |
|
| |
.rwx | two/b.txt |
| 0 |
|
| |
.rwx | two/c.txt |
| 0 |
|
| |
.rwx | two/three/a.txt |
| 0 |
|
| |
.rwx | two/three/b.txt |
| 0 |
|
| |
.rwx | two/three/c.txt |
| 0 |
|
| |
.rwx | two/three/d.other |
| 0 |
|
| |
hier/one/.git | drwx | |||||
.rwx | something |
| 9 |
| something | |
hier/one/two | drwx | |||||
.rwx | a.txt |
| 0 |
|
| |
.rwx | b.txt |
| 0 |
|
| |
.rwx | c.txt |
| 0 |
|
| |
.rwx | three/a.txt |
| 0 |
|
| |
.rwx | three/b.txt |
| 0 |
|
| |
.rwx | three/c.txt |
| 0 |
|
| |
.rwx | three/d.other |
| 0 |
|
| |
hier/one/two/three | drwx | |||||
.rwx | a.txt |
| 0 |
|
| |
.rwx | b.txt |
| 0 |
|
| |
.rwx | c.txt |
| 0 |
|
| |
.rwx | d.other |
| 0 |
|
| |
package/input/a/b/c | drwx | |||||
.rwx | d.txt |
| 0 |
|
| |
.rwx | e.txt |
| 0 |
|
| |
package/output | drwx | |||||
.rwx | a.b.c.d.html |
| 0 |
|
| |
size | drwx | |||||
.rwx | one-hundred.txt |
| 100 |
| 123456789… | |
.rwx | one-thousand.txt |
| 1000 |
| 1234567890123456789012345678901… | |
.rwx | one.txt |
| 1 |
| 1 | |
.rwx | ten-twentyfour.txt |
| 1025 |
| 1234567890123456789012345678901… | |
.rwx | ten.txt |
| 10 |
| 1234567890 | |
.rwx | two.txt |
| 2 |
| 12 | |
.rwx | zero.txt |
| 0 |
|
|
Schematron checks
<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron"
xmlns:t="http://xproc.org/ns/testsuite/3.0" queryBinding="xslt2">
<s:ns prefix="c"
uri="http://www.w3.org/ns/xproc-step"/>
<s:pattern>
<s:rule context="/">
<s:assert test="c:directory">The root is wrong.</s:assert>
</s:rule>
</s:pattern>
<s:pattern>
<s:rule context="/c:directory">
<s:assert test="ends-with(@xml:base, '/testfolder/attr/')">The base URI is wrong.</s:assert>
<s:assert test="count(c:file) = 4">The number of files is wrong.</s:assert>
<s:assert test="c:file[@name='writable.txt']">The one.txt file is missing</s:assert>
<s:assert test="c:file[@name='executable.sh']">The two.txt file is missing</s:assert>
<s:assert test="c:file[@name='unwritable.txt']">The three.txt file is missing</s:assert>
<s:assert test="c:file[@name='readable.txt']">The three.txt file is missing</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Revision history
- 12 Jun 2025, Norm Tovey-Walsh
Created test.