[InitScratchFS, Always, TestOutput (
(* Pick a file from cwd which isn't likely to change. *)
[["mkdir"; "/upload"];
- ["upload"; "../COPYING.LIB"; "/upload/COPYING.LIB"];
+ ["upload"; "../../COPYING.LIB"; "/upload/COPYING.LIB"];
["checksum"; "md5"; "/upload/COPYING.LIB"]],
Digest.to_hex (Digest.file "COPYING.LIB"))],
"upload a file from the local machine",
[InitScratchFS, Always, TestOutput (
(* Pick a file from cwd which isn't likely to change. *)
[["mkdir"; "/download"];
- ["upload"; "../COPYING.LIB"; "/download/COPYING.LIB"];
+ ["upload"; "../../COPYING.LIB"; "/download/COPYING.LIB"];
["download"; "/download/COPYING.LIB"; "testdownload.tmp"];
["upload"; "testdownload.tmp"; "/download/upload"];
["checksum"; "md5"; "/download/upload"]],
("tar_in", (RErr, [FileIn "tarfile"; Pathname "directory"], []), 69, [],
[InitScratchFS, Always, TestOutput (
[["mkdir"; "/tar_in"];
- ["tar_in"; "../images/helloworld.tar"; "/tar_in"];
+ ["tar_in"; "../data/helloworld.tar"; "/tar_in"];
["cat"; "/tar_in/hello"]], "hello\n")],
"unpack tarfile to directory",
"\
("tgz_in", (RErr, [FileIn "tarball"; Pathname "directory"], []), 71, [],
[InitScratchFS, Always, TestOutput (
[["mkdir"; "/tgz_in"];
- ["tgz_in"; "../images/helloworld.tar.gz"; "/tgz_in"];
+ ["tgz_in"; "../data/helloworld.tar.gz"; "/tgz_in"];
["cat"; "/tgz_in/hello"]], "hello\n")],
"unpack compressed tarball to directory",
"\
("txz_in", (RErr, [FileIn "tarball"; Pathname "directory"], []), 229, [Optional "xz"],
[InitScratchFS, Always, TestOutput (
[["mkdir"; "/txz_in"];
- ["txz_in"; "../images/helloworld.tar.xz"; "/txz_in"];
+ ["txz_in"; "../data/helloworld.tar.xz"; "/txz_in"];
["cat"; "/txz_in/hello"]], "hello\n")],
"unpack compressed tarball to directory",
"\
("checksum_device", (RString "checksum", [String "csumtype"; Device "device"], []), 237, [],
[InitISOFS, Always, TestOutputFileMD5 (
[["checksum_device"; "md5"; "/dev/sdd"]],
- "../images/test.iso")],
+ "../data/test.iso")],
"compute MD5, SHAx or CRC checksum of the contents of a device",
"\
This call computes the MD5, SHAx or CRC checksum of the
("base64_in", (RErr, [FileIn "base64file"; Pathname "filename"], []), 242, [],
[InitScratchFS, Always, TestOutput (
- [["base64_in"; "../images/hello.b64"; "/base64_in"];
+ [["base64_in"; "../data/hello.b64"; "/base64_in"];
["cat"; "/base64_in"]], "hello\n")],
"upload base64-encoded data to file",
"\
("upload_offset", (RErr, [FileIn "filename"; Dev_or_Path "remotefilename"; Int64 "offset"], []), 273, [Progress],
(let md5 = Digest.to_hex (Digest.file "COPYING.LIB") in
[InitScratchFS, Always, TestOutput (
- [["upload_offset"; "../COPYING.LIB"; "/upload_offset"; "0"];
+ [["upload_offset"; "../../COPYING.LIB"; "/upload_offset"; "0"];
["checksum"; "md5"; "/upload_offset"]], md5)]),
"upload a file from the local machine with offset",
"\
[InitScratchFS, Always, TestOutput (
(* Pick a file from cwd which isn't likely to change. *)
[["mkdir"; "/download_offset"];
- ["upload"; "../COPYING.LIB"; "/download_offset/COPYING.LIB"];
+ ["upload"; "../../COPYING.LIB"; "/download_offset/COPYING.LIB"];
["download_offset"; "/download_offset/COPYING.LIB"; "testdownload.tmp"; offset; size];
["upload_offset"; "testdownload.tmp"; "/download_offset/COPYING.LIB"; offset];
["checksum"; "md5"; "/download_offset/COPYING.LIB"]], md5)]),
glob copy-out /home/* .");
+ ("delete_event", (RErr,[], []), -1, [], [],
+ "delete a previously registered event handler",
+ " delete-event name
+
+Delete the event handler which was previously registered as C<name>.
+If multiple event handlers were registered with the same name, they
+are all deleted.
+
+See also the guestfish commands C<event> and C<list-events>.");
+
("display", (RErr,[], []), -1, [], [],
"display an image",
" display filename
commands C<vi> or C<emacs> you will get those corresponding
editors.");
+ ("event", (RErr,[], []), -1, [], [],
+ "register a handler for an event or events",
+ " event name eventset \"shell script ...\"
+
+Register a shell script fragment which is executed when an
+event is raised. See L<guestfs(3)/guestfs_set_event_callback>
+for a discussion of the event API in libguestfs.
+
+The C<name> parameter is a name that you give to this event
+handler. It can be any string (even the empty string) and is
+simply there so you can delete the handler using the guestfish
+C<delete-event> command.
+
+The C<eventset> parameter is a comma-separated list of one
+or more events, for example C<close> or C<close,trace>. The
+special value C<*> means all events.
+
+The third and final parameter is the shell script fragment
+(or any external command) that is executed when any of the
+events in the eventset occurs. It is executed using
+C<$SHELL -c>, or if C<$SHELL> is not set then C</bin/sh -c>.
+
+The shell script fragment receives callback parameters as
+arguments C<$1>, C<$2> etc. The actual event that was
+called is available in the environment variable C<$EVENT>.
+
+ event \"\" close \"echo closed\"
+ event messages appliance,library,trace \"echo $@\"
+ event \"\" progress \"echo progress: $3/$4\"
+ event \"\" * \"echo $EVENT $@\"
+
+See also the guestfish commands C<delete-event> and C<list-events>.");
+
("glob", (RErr,[], []), -1, [], [],
"expand wildcards in command",
" glob command args...
Note that C<!cd> won't do what you might expect.");
+ ("list_events", (RErr,[], []), -1, [], [],
+ "list event handlers",
+ " list-events
+
+List the event handlers registered using the guestfish
+C<event> command.");
+
("man", (RErr,[], []), -1, [FishAlias "manual"], [],
"open the manual",
" man