summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2009-04-08 23:47:28 +0100
committerRichard Jones <rjones@redhat.com>2009-04-08 23:47:28 +0100
commitf4299f7ea55c4bbc9302e102d2fc801829e75ef6 (patch)
tree817d7c3e016e8b62882f864bd4efda56c967630d /src
parent45f3a8981723079a5a020ab9438593531b1d8368 (diff)
downloadlibguestfs-f4299f7ea55c4bbc9302e102d2fc801829e75ef6.tar.gz
libguestfs-f4299f7ea55c4bbc9302e102d2fc801829e75ef6.tar.xz
libguestfs-f4299f7ea55c4bbc9302e102d2fc801829e75ef6.zip
Definition and implementation of new guestfs_read_lines API call.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/generator.ml13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/generator.ml b/src/generator.ml
index 95a09853..af19fdad 100755
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -310,6 +310,19 @@ of the L<vgs(8)> command. The \"full\" version includes all fields.");
"\
List all the logical volumes detected. This is the equivalent
of the L<lvs(8)> command. The \"full\" version includes all fields.");
+
+ ("read_lines", (RStringList "lines", P1 (String "path")), 15, [],
+ "read file as lines",
+ "\
+Return the contents of the file named C<path>.
+
+The file contents are returned as a list of lines. Trailing
+C<LF> and C<CRLF> character sequences are I<not> returned.
+
+Note that this function cannot correctly handle binary files
+(specifically, files containing C<\\0> character which is treated
+as end of line). For those you need to use the C<guestfs_read_file>
+function which has a more complex interface.");
]
let all_functions = non_daemon_functions @ daemon_functions