diff options
author | Richard Jones <rjones@redhat.com> | 2009-04-13 23:58:33 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-04-13 23:58:33 +0100 |
commit | adefe14e308a0f8cf73f9c60693a3dbbded157b9 (patch) | |
tree | cc1ecd798dd05c422ddcf99c1cdbef307aacb8fd /perl | |
parent | 42283403886da648bb239177369aa65c0a659255 (diff) | |
download | libguestfs-adefe14e308a0f8cf73f9c60693a3dbbded157b9.tar.gz libguestfs-adefe14e308a0f8cf73f9c60693a3dbbded157b9.tar.xz libguestfs-adefe14e308a0f8cf73f9c60693a3dbbded157b9.zip |
Generated files for file(1) command.
Diffstat (limited to 'perl')
-rw-r--r-- | perl/Guestfs.xs | 16 | ||||
-rw-r--r-- | perl/lib/Sys/Guestfs.pm | 10 |
2 files changed, 26 insertions, 0 deletions
diff --git a/perl/Guestfs.xs b/perl/Guestfs.xs index 580b743d..14a92258 100644 --- a/perl/Guestfs.xs +++ b/perl/Guestfs.xs @@ -914,3 +914,19 @@ lvm_remove_all (g) croak ("lvm_remove_all: %s", guestfs_last_error (g)); } +SV * +file (g, path) + guestfs_h *g; + char *path; +PREINIT: + char *description; + CODE: + description = guestfs_file (g, path); + if (description == NULL) { + croak ("file: %s", guestfs_last_error (g)); + } + RETVAL = newSVpv (description, 0); + free (description); + OUTPUT: + RETVAL + diff --git a/perl/lib/Sys/Guestfs.pm b/perl/lib/Sys/Guestfs.pm index c708a29c..9d050b47 100644 --- a/perl/lib/Sys/Guestfs.pm +++ b/perl/lib/Sys/Guestfs.pm @@ -289,6 +289,16 @@ This returns C<true> if and only if there is a file, directory See also C<$h-E<gt>is_file>, C<$h-E<gt>is_dir>, C<$h-E<gt>stat>. +=item $description = $h->file ($path); + +This call uses the standard L<file(1)> command to determine +the type or contents of the file. This also works on devices, +for example to find out whether a partition contains a filesystem. + +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 $autosync = $h->get_autosync (); Get the autosync flag. |