aboutsummaryrefslogtreecommitdiffstats
path: root/extension/readfile.3am
diff options
context:
space:
mode:
authorJuergen Kahrs <Juergen.Kahrs@googlemail.com>2014-06-24 13:18:33 +0200
committerJuergen Kahrs <Juergen.Kahrs@googlemail.com>2014-06-24 13:18:33 +0200
commitf1245d04a9f076773c60499b468f44ed9c91b59b (patch)
tree2b49234400150bfaac7ebf8c017562300edc7471 /extension/readfile.3am
parentee9707cc44eea3ca64cb71666ac3e8ed26a3bb7f (diff)
parent78ded8ee8f11a321c96417e7d02dac2f5723a221 (diff)
downloadegawk-f1245d04a9f076773c60499b468f44ed9c91b59b.tar.gz
egawk-f1245d04a9f076773c60499b468f44ed9c91b59b.tar.bz2
egawk-f1245d04a9f076773c60499b468f44ed9c91b59b.zip
Merge remote-tracking branch 'origin/master' into cmake
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