| 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <!DOCTYPE book [ |
| 3 | <!ENTITY % eclent SYSTEM "ecl.ent"> |
| 4 | %eclent; |
| 5 | ]> |
| 6 | <book xmlns="http://docbook.org/ns/docbook" version="5.0" xml:lang="en"> |
| 7 | <chapter xml:id="ansi.files"> |
| 8 | <title>Files</title> |
| 9 | |
| 10 | <section xml:id="ansi.files.dict"> |
| 11 | <title>Dictionary</title> |
| 12 | |
| 13 | <section xml:id="ansi.files.directory"> |
| 14 | <title><function>DIRECTORY</function></title> |
| 15 | |
| 16 | <para>This function does not have any additional arguments other than the |
| 17 | ones described in &ANSI;. To list files and directories, it follows the |
| 18 | rules for matching pathnames described in <xref |
| 19 | linkend="ansi.pathnames.wild"/>. In short, you have the following |
| 20 | practical examples:</para> |
| 21 | <table> |
| 22 | <title>Examples of using <function>DIRECTORY</function></title> |
| 23 | <tgroup cols="2"> |
| 24 | <thead> |
| 25 | <row><entry>Argument</entry><entry>Meaning</entry></row> |
| 26 | </thead> |
| 27 | <tbody> |
| 28 | <row> |
| 29 | <entry><literal>"/home/jlr/*.*"</literal></entry> |
| 30 | <entry>List all files in directory <filename>/home/jlr/</filename> Note |
| 31 | that it lists only files, not directories!</entry> |
| 32 | </row> |
| 33 | <row> |
| 34 | <entry><literal>"/home/jlr/*"</literal></entry> |
| 35 | <entry>Same as before, but only files without type.</entry> |
| 36 | </row> |
| 37 | <row> |
| 38 | <entry><literal>"/home/jlr/*/"</literal></entry> |
| 39 | <entry>List all directories contained in |
| 40 | <filename>/home/jlr/</filename>. Nested directories are not |
| 41 | navigated.</entry> |
| 42 | </row> |
| 43 | <row> |
| 44 | <entry><literal>"/home/jlr/**/*.*"</literal></entry> |
| 45 | <entry>List all files in all directories contained in |
| 46 | <filename>/home/jlr/</filename>, recursively. Nested directories are |
| 47 | navigated.</entry> |
| 48 | </row> |
| 49 | </tbody> |
| 50 | </tgroup> |
| 51 | </table> |
| 52 | </section> |
| 53 | </section> |
| 54 | |
| 55 | <xi:include href="ref_c_files.xml" xpointer="ansi.files.c-dict" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 56 | |
| 57 | </chapter> |
| 58 | </book> |