diff options
author | Richard Jones <rjones@trick.home.annexia.org> | 2009-06-22 08:20:42 +0100 |
---|---|---|
committer | Richard Jones <rjones@trick.home.annexia.org> | 2009-06-22 08:20:42 +0100 |
commit | ad8a256f54a6cb99f89bb444c8597a152a793dce (patch) | |
tree | f82b1ef05fe745c9cb2ec93275b9d0909f1a882e /perl | |
parent | 05c34c1c1479bb07b31cfbf912743a8cf014a636 (diff) | |
download | libguestfs-ad8a256f54a6cb99f89bb444c8597a152a793dce.tar.gz libguestfs-ad8a256f54a6cb99f89bb444c8597a152a793dce.tar.xz libguestfs-ad8a256f54a6cb99f89bb444c8597a152a793dce.zip |
Generated code for 'glob-expand'.
Diffstat (limited to 'perl')
-rw-r--r-- | perl/Guestfs.xs | 19 | ||||
-rw-r--r-- | perl/lib/Sys/Guestfs.pm | 13 |
2 files changed, 32 insertions, 0 deletions
diff --git a/perl/Guestfs.xs b/perl/Guestfs.xs index 8a6c4bb9..5905dc5e 100644 --- a/perl/Guestfs.xs +++ b/perl/Guestfs.xs @@ -2583,3 +2583,22 @@ PREINIT: } free (lines); +void +glob_expand (g, pattern) + guestfs_h *g; + char *pattern; +PREINIT: + char **paths; + int i, n; + PPCODE: + paths = guestfs_glob_expand (g, pattern); + if (paths == NULL) + croak ("glob_expand: %s", guestfs_last_error (g)); + for (n = 0; paths[n] != NULL; ++n) /**/; + EXTEND (SP, n); + for (i = 0; i < n; ++i) { + PUSHs (sv_2mortal (newSVpv (paths[i], 0))); + free (paths[i]); + } + free (paths); + diff --git a/perl/lib/Sys/Guestfs.pm b/perl/lib/Sys/Guestfs.pm index 9329b769..436f218c 100644 --- a/perl/lib/Sys/Guestfs.pm +++ b/perl/lib/Sys/Guestfs.pm @@ -676,6 +676,19 @@ For more information on states, see L<guestfs(3)>. This returns the verbose messages flag. +=item @paths = $h->glob_expand ($pattern); + +This command searches for all the pathnames matching +C<pattern> according to the wildcard expansion rules +used by the shell. + +If no paths match, then this returns an empty list +(note: not an error). + +It is just a wrapper around the C L<glob(3)> function +with flags C<GLOB_MARK|GLOB_BRACE>. +See that manual page for more details. + =item $h->grub_install ($root, $device); This command installs GRUB (the Grand Unified Bootloader) on |