summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2009-04-13 23:58:02 +0100
committerRichard Jones <rjones@redhat.com>2009-04-13 23:58:02 +0100
commit42283403886da648bb239177369aa65c0a659255 (patch)
tree49bc2c02f931b3fee7fc7436a276f842db236f2a /src
parenta29a2e99ce120415941894da45087a360e6c65d3 (diff)
downloadlibguestfs-42283403886da648bb239177369aa65c0a659255.tar.gz
libguestfs-42283403886da648bb239177369aa65c0a659255.tar.xz
libguestfs-42283403886da648bb239177369aa65c0a659255.zip
Added file(1) command.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/generator.ml19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/generator.ml b/src/generator.ml
index 84ee90ff..c9da57e9 100755
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -950,6 +950,25 @@ Some internal mounts are not unmounted by this call.");
This command removes all LVM logical volumes, volume groups
and physical volumes.");
+ ("file", (RString "description", [String "path"]), 49, [],
+ [InitBasicFS, TestOutput (
+ [["touch"; "/new"];
+ ["file"; "/new"]], "empty");
+ InitBasicFS, TestOutput (
+ [["write_file"; "/new"; "some content\n"; "0"];
+ ["file"; "/new"]], "ASCII text");
+ InitBasicFS, TestLastFail (
+ [["file"; "/nofile"]])],
+ "determine file type",
+ "\
+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).");
+
]
let all_functions = non_daemon_functions @ daemon_functions