diff options
author | Richard Jones <rjones@redhat.com> | 2009-10-19 17:44:16 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-10-20 10:31:54 +0100 |
commit | 42c89f2e6bd956f738080b5aec53b7520f4f96da (patch) | |
tree | 07cd56e1d28b20608eeb40ffe554ed242cd57ccb /src | |
parent | 55f5dc6f1195d7dec5687ece3f6e74dde649ff7c (diff) | |
download | libguestfs-42c89f2e6bd956f738080b5aec53b7520f4f96da.tar.gz libguestfs-42c89f2e6bd956f738080b5aec53b7520f4f96da.tar.xz libguestfs-42c89f2e6bd956f738080b5aec53b7520f4f96da.zip |
New API: find0 (unlimited version of find)
This adds a new API call guestfs_find0, which is like guestfs_find
but mainly doesn't suffer from the protocol limit of the earlier
command. The earlier command is not deprecated because it is
still very useful.
guestfs_find0 uses a FileOut parameter and writes the results to
an external file. The filenames in the output are separated by
ASCII NUL characters (so a bit like "find -print0").
There is also the addition of a regression test for this command.
Diffstat (limited to 'src')
-rw-r--r-- | src/MAX_PROC_NR | 2 | ||||
-rwxr-xr-x | src/generator.ml | 37 |
2 files changed, 37 insertions, 2 deletions
diff --git a/src/MAX_PROC_NR b/src/MAX_PROC_NR index 6bb2f98f..0f11735f 100644 --- a/src/MAX_PROC_NR +++ b/src/MAX_PROC_NR @@ -1 +1 @@ -195 +196 diff --git a/src/generator.ml b/src/generator.ml index 74890b4c..cea5178b 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -2525,7 +2525,9 @@ then the returned list from C<guestfs_find> C</tmp> would be If C<directory> is not a directory, then this command returns an error. -The returned list is sorted."); +The returned list is sorted. + +See also C<guestfs_find0>."); ("e2fsck_f", (RErr, [Device "device"]), 108, [], [], (* lvresize tests this *) @@ -3610,6 +3612,39 @@ You can use this command to test the connection through to the daemon. See also C<guestfs_ping_daemon>."); + ("find0", (RErr, [Pathname "directory"; FileOut "files"]), 196, [], + [], (* There is a regression test for this. *) + "find all files and directories, returning NUL-separated list", + "\ +This command lists out all files and directories, recursively, +starting at C<directory>, placing the resulting list in the +external file called C<files>. + +This command works the same way as C<guestfs_find> with the +following exceptions: + +=over 4 + +=item * + +The resulting list is written to an external file. + +=item * + +Items (filenames) in the result are separated +by C<\\0> characters. See L<find(1)> option I<-print0>. + +=item * + +This command is not limited in the number of names that it +can return. + +=item * + +The result list is not sorted. + +=back"); + ] let all_functions = non_daemon_functions @ daemon_functions |