summaryrefslogtreecommitdiff
path: root/extension/readfile.3am
diff options
context:
space:
mode:
Diffstat (limited to 'extension/readfile.3am')
-rw-r--r--extension/readfile.3am20
1 files changed, 18 insertions, 2 deletions
diff --git a/extension/readfile.3am b/extension/readfile.3am
index 688d9cd5..0cb2eb5b 100644
--- a/extension/readfile.3am
+++ b/extension/readfile.3am
@@ -1,4 +1,4 @@
-.TH READFILE 3am "Jan 15 2013" "Free Software Foundation" "GNU Awk Extension Modules"
+.TH READFILE 3am "Mar 24 2013" "Free Software Foundation" "GNU Awk Extension Modules"
.SH NAME
readfile \- return the entire contents of a file as a string
.SH SYNOPSIS
@@ -6,6 +6,14 @@ readfile \- return the entire contents of a file as a string
@load "readfile"
.sp
result = readfile("/some/path")
+.sp
+.ft R
+For making whole files be single records:
+.sp
+.ft CW
+@load "readfile"
+.br
+BEGIN { PROCINFO["readfile"] = 1 }
.ft R
.SH DESCRIPTION
The
@@ -18,6 +26,14 @@ the requested file.
.PP
Upon error, the function returns the empty string and sets
.BR ERRNO .
+.PP
+In addition, it adds an input parser that is activated if
+.ft CW
+PROCINFO["readfile"]
+.ft R
+exists.
+When activated, each input file is returned in its entirety as \f(CW$0\fR.
+\f(CWRT\fP is set to the null string.
... .SH NOTES
... .SH BUGS
.SH EXAMPLE
@@ -47,7 +63,7 @@ if (contents == "" && ERRNO != "") {
Arnold Robbins,
.BR arnold@skeeve.com .
.SH COPYING PERMISSIONS
-Copyright \(co 2012, 2013,
+Copyright \(co 2012, 2013, 2014,
Free Software Foundation, Inc.
.PP
Permission is granted to make and distribute verbatim copies of