summaryrefslogtreecommitdiffstats
path: root/perl/lib/Sys/Guestfs.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl/lib/Sys/Guestfs.pm')
-rw-r--r--perl/lib/Sys/Guestfs.pm27
1 files changed, 27 insertions, 0 deletions
diff --git a/perl/lib/Sys/Guestfs.pm b/perl/lib/Sys/Guestfs.pm
index 62f3e7b0..e7f89248 100644
--- a/perl/lib/Sys/Guestfs.pm
+++ b/perl/lib/Sys/Guestfs.pm
@@ -531,6 +531,33 @@ The exact command which runs is C<file -bsL path>. Note in
particular that the filename is not prepended to the output
(the C<-b> option).
+=item @names = $h->find ($directory);
+
+This command lists out all files and directories, recursively,
+starting at C<directory>. It is essentially equivalent to
+running the shell command C<find directory -print> but some
+post-processing happens on the output, described below.
+
+This returns a list of strings I<without any prefix>. Thus
+if the directory structure was:
+
+ /tmp/a
+ /tmp/b
+ /tmp/c/d
+
+then the returned list from C<$h-E<gt>find> C</tmp> would be
+4 elements:
+
+ a
+ b
+ c
+ c/d
+
+If C<directory> is not a directory, then this command returns
+an error.
+
+The returned list is sorted.
+
=item $status = $h->fsck ($fstype, $device);
This runs the filesystem checker (fsck) on C<device> which