X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Fgenerator.ml;h=e30f5ebfdfc1219f4450a651e74a629e0b2ec81d;hb=0e6e32025885286e2de39efca34ced2aaf26b3a3;hp=3a35fa2c5be3f30e0add582445fa4c2128fcacee;hpb=7c3a90f94cd6b8fec9cdd1c052b91a14c0ee0e0e;p=libguestfs.git diff --git a/src/generator.ml b/src/generator.ml index 3a35fa2..e30f5eb 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -3141,6 +3141,66 @@ matching lines."); Return the canonicalized absolute pathname of C. The returned path has no C<.>, C<..> or symbolic link path elements."); + ("ln", (RErr, [String "target"; String "linkname"]), 164, [], + [InitBasicFS, Always, TestOutputStruct ( + [["touch"; "/a"]; + ["ln"; "/a"; "/b"]; + ["stat"; "/b"]], [CompareWithInt ("nlink", 2)])], + "create a hard link", + "\ +This command creates a hard link using the C command."); + + ("ln_f", (RErr, [String "target"; String "linkname"]), 165, [], + [InitBasicFS, Always, TestOutputStruct ( + [["touch"; "/a"]; + ["touch"; "/b"]; + ["ln_f"; "/a"; "/b"]; + ["stat"; "/b"]], [CompareWithInt ("nlink", 2)])], + "create a hard link", + "\ +This command creates a hard link using the C command. +The C<-f> option removes the link (C) if it exists already."); + + ("ln_s", (RErr, [String "target"; String "linkname"]), 166, [], + [InitBasicFS, Always, TestOutputStruct ( + [["touch"; "/a"]; + ["ln_s"; "a"; "/b"]; + ["lstat"; "/b"]], [CompareWithInt ("mode", 0o120777)])], + "create a symbolic link", + "\ +This command creates a symbolic link using the C command."); + + ("ln_sf", (RErr, [String "target"; String "linkname"]), 167, [], + [InitBasicFS, Always, TestOutput ( + [["mkdir_p"; "/a/b"]; + ["touch"; "/a/b/c"]; + ["ln_sf"; "../d"; "/a/b/c"]; + ["readlink"; "/a/b/c"]], "../d")], + "create a symbolic link", + "\ +This command creates a symbolic link using the C command, +The C<-f> option removes the link (C) if it exists already."); + + ("readlink", (RString "link", [String "path"]), 168, [], + [] (* XXX tested above *), + "read the target of a symbolic link", + "\ +This command reads the target of a symbolic link."); + + ("fallocate", (RErr, [String "path"; Int "len"]), 169, [], + [InitBasicFS, Always, TestOutputStruct ( + [["fallocate"; "/a"; "1000000"]; + ["stat"; "/a"]], [CompareWithInt ("size", 1_000_000)])], + "preallocate a file in the guest filesystem", + "\ +This command preallocates a file (containing zero bytes) named +C of size C bytes. If the file exists already, it +is overwritten. + +Do not confuse this with the guestfish-specific +C command which allocates a file in the host and +attaches it as a device."); + ] let all_functions = non_daemon_functions @ daemon_functions