X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=guestfs-actions.pod;h=18c3910c756303c5ad2f6ac71ec8f43e70e7eec5;hp=755479fd1804c7415bad70a24fb490c437b6c068;hb=107a76ad3680fda05cfd58136d62eeab4e77a8dc;hpb=da947eadcfa1367c2d634667068db813a87a6dd1 diff --git a/guestfs-actions.pod b/guestfs-actions.pod index 755479f..18c3910 100644 --- a/guestfs-actions.pod +++ b/guestfs-actions.pod @@ -614,6 +614,33 @@ to find out what you can do. This function returns a string, or NULL on error. I. +=head2 guestfs_df + + char *guestfs_df (guestfs_h *handle); + +This command runs the C command to report disk space used. + +This command is mostly useful for interactive sessions. It +is I intended that you try to parse the output string. +Use C from programs. + +This function returns a string, or NULL on error. +I. + +=head2 guestfs_df_h + + char *guestfs_df_h (guestfs_h *handle); + +This command runs the C command to report disk space used +in human-readable format. + +This command is mostly useful for interactive sessions. It +is I intended that you try to parse the output string. +Use C from programs. + +This function returns a string, or NULL on error. +I. + =head2 guestfs_dmesg char *guestfs_dmesg (guestfs_h *handle); @@ -662,6 +689,23 @@ so that the maximum guest memory is freed. This function returns 0 on success or -1 on error. +=head2 guestfs_du + + int64_t guestfs_du (guestfs_h *handle, + const char *path); + +This command runs the C command to estimate file space +usage for C. + +C can be a file or a directory. If C is a directory +then the estimate includes the contents of the directory and all +subdirectories (recursively). + +The result is the estimated size in I +(ie. units of 1024 bytes). + +On error this function returns -1. + =head2 guestfs_e2fsck_f int guestfs_e2fsck_f (guestfs_h *handle, @@ -915,6 +959,44 @@ C, with the root directory being C. This function returns 0 on success or -1 on error. +=head2 guestfs_head + + char **guestfs_head (guestfs_h *handle, + const char *path); + +This command returns up to the first 10 lines of a file as +a list of strings. + +This function returns a NULL-terminated array of strings +(like L), or NULL if there was an error. +I. + +Because of the message protocol, there is a transfer limit +of somewhere between 2MB and 4MB. To transfer large files you should use +FTP. + +=head2 guestfs_head_n + + char **guestfs_head_n (guestfs_h *handle, + int nrlines, + const char *path); + +If the parameter C is a positive number, this returns the first +C lines of the file C. + +If the parameter C is a negative number, this returns lines +from the file C, excluding the last C lines. + +If the parameter C is zero, this returns an empty list. + +This function returns a NULL-terminated array of strings +(like L), or NULL if there was an error. +I. + +Because of the message protocol, there is a transfer limit +of somewhere between 2MB and 4MB. To transfer large files you should use +FTP. + =head2 guestfs_hexdump char *guestfs_hexdump (guestfs_h *handle, @@ -930,6 +1012,25 @@ Because of the message protocol, there is a transfer limit of somewhere between 2MB and 4MB. To transfer large files you should use FTP. +=head2 guestfs_initrd_list + + char **guestfs_initrd_list (guestfs_h *handle, + const char *path); + +This command lists out files contained in an initrd. + +The files are listed without any initial C character. The +files are listed in the order they appear (not necessarily +alphabetical). Directory names are listed as separate items. + +Old Linux kernels (2.4 and earlier) used a compressed ext2 +filesystem as initrd. We I support the newer initramfs +format (compressed cpio files). + +This function returns a NULL-terminated array of strings +(like L), or NULL if there was an error. +I. + =head2 guestfs_is_busy int guestfs_is_busy (guestfs_h *handle); @@ -1689,7 +1790,7 @@ can easily destroy all your data>. int guestfs_sfdisk_N (guestfs_h *handle, const char *device, - int n, + int partnum, int cyls, int heads, int sectors, @@ -1873,6 +1974,44 @@ closing the handle. This function returns 0 on success or -1 on error. +=head2 guestfs_tail + + char **guestfs_tail (guestfs_h *handle, + const char *path); + +This command returns up to the last 10 lines of a file as +a list of strings. + +This function returns a NULL-terminated array of strings +(like L), or NULL if there was an error. +I. + +Because of the message protocol, there is a transfer limit +of somewhere between 2MB and 4MB. To transfer large files you should use +FTP. + +=head2 guestfs_tail_n + + char **guestfs_tail_n (guestfs_h *handle, + int nrlines, + const char *path); + +If the parameter C is a positive number, this returns the last +C lines of the file C. + +If the parameter C is a negative number, this returns lines +from the file C, starting with the C<-nrlines>th line. + +If the parameter C is zero, this returns an empty list. + +This function returns a NULL-terminated array of strings +(like L), or NULL if there was an error. +I. + +Because of the message protocol, there is a transfer limit +of somewhere between 2MB and 4MB. To transfer large files you should use +FTP. + =head2 guestfs_tar_in int guestfs_tar_in (guestfs_h *handle, @@ -2088,6 +2227,36 @@ to complete. This function returns 0 on success or -1 on error. +=head2 guestfs_wc_c + + int guestfs_wc_c (guestfs_h *handle, + const char *path); + +This command counts the characters in a file, using the +C external command. + +On error this function returns -1. + +=head2 guestfs_wc_l + + int guestfs_wc_l (guestfs_h *handle, + const char *path); + +This command counts the lines in a file, using the +C external command. + +On error this function returns -1. + +=head2 guestfs_wc_w + + int guestfs_wc_w (guestfs_h *handle, + const char *path); + +This command counts the words in a file, using the +C external command. + +On error this function returns -1. + =head2 guestfs_write_file int guestfs_write_file (guestfs_h *handle,