aboutsummaryrefslogtreecommitdiffstats
path: root/doc/gawk.texi
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2014-03-27 22:49:58 +0200
committerArnold D. Robbins <arnold@skeeve.com>2014-03-27 22:49:58 +0200
commit4d396858eb897f2bb6d318b851a369ee92e50147 (patch)
treed70bd6e9fd6750d0bf67a33374c3864a7ab4ac8d /doc/gawk.texi
parent17cb726be0dea75864a89d31054459c02702786e (diff)
downloadegawk-4d396858eb897f2bb6d318b851a369ee92e50147.tar.gz
egawk-4d396858eb897f2bb6d318b851a369ee92e50147.tar.bz2
egawk-4d396858eb897f2bb6d318b851a369ee92e50147.zip
Add input parser to readfile extension, document it and test it.
Diffstat (limited to 'doc/gawk.texi')
-rw-r--r--doc/gawk.texi8
1 files changed, 7 insertions, 1 deletions
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 6c41c99a..139af5f7 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -33173,7 +33173,7 @@ ret = reada("arraydump.bin", array)
@subsection Reading An Entire File
The @code{readfile} extension adds a single function
-named @code{readfile()}:
+named @code{readfile()}, and an input parser:
@table @code
@item @@load "readfile"
@@ -33184,6 +33184,12 @@ This is how you load the extension.
The argument is the name of the file to read. The return value is a
string containing the entire contents of the requested file. Upon error,
the function returns the empty string and sets @code{ERRNO}.
+
+@item BEGIN @{ PROCINFO["readfile"] = 1 @}
+In addition, the extension adds an input parser that is activated if
+@code{PROCINFO["readfile"]} exists.
+When activated, each input file is returned in its entirety as @code{$0}.
+@code{RT} is set to the null string.
@end table
Here is an example: