diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-06-29 12:26:11 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2009-06-29 12:26:11 +0100 |
commit | b2ed0f4c55c2bd3d07341ba2207f0cb238eb4e18 (patch) | |
tree | 1a8afad7895f932501ff806a5dd3bfc9f2ed5f26 /java | |
parent | 405cf2a5772611ea05cca9fefa843154a9bc64a3 (diff) | |
download | libguestfs-b2ed0f4c55c2bd3d07341ba2207f0cb238eb4e18.tar.gz libguestfs-b2ed0f4c55c2bd3d07341ba2207f0cb238eb4e18.tar.xz libguestfs-b2ed0f4c55c2bd3d07341ba2207f0cb238eb4e18.zip |
Generated code for df / df-h.
Diffstat (limited to 'java')
-rw-r--r-- | java/com/redhat/et/libguestfs/GuestFS.java | 44 | ||||
-rw-r--r-- | java/com_redhat_et_libguestfs_GuestFS.c | 36 |
2 files changed, 80 insertions, 0 deletions
diff --git a/java/com/redhat/et/libguestfs/GuestFS.java b/java/com/redhat/et/libguestfs/GuestFS.java index 30913327..1d65581a 100644 --- a/java/com/redhat/et/libguestfs/GuestFS.java +++ b/java/com/redhat/et/libguestfs/GuestFS.java @@ -3725,4 +3725,48 @@ public HashMap<String,String> test0rhashtableerr () private native String[] _tail_n (long g, int nrlines, String path) throws LibGuestFSException; + /** + * report file system disk space usage + * <p> + * This command runs the "df" command to report disk space + * used. + * <p> + * This command is mostly useful for interactive sessions. + * It is *not* intended that you try to parse the output + * string. Use "statvfs" from programs. + * <p> + * @throws LibGuestFSException + */ + public String df () + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("df: handle is closed"); + return _df (g); + } + private native String _df (long g) + throws LibGuestFSException; + + /** + * report file system disk space usage (human readable) + * <p> + * This command runs the "df -h" command to report disk + * space used in human-readable format. + * <p> + * This command is mostly useful for interactive sessions. + * It is *not* intended that you try to parse the output + * string. Use "statvfs" from programs. + * <p> + * @throws LibGuestFSException + */ + public String df_h () + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("df_h: handle is closed"); + return _df_h (g); + } + private native String _df_h (long g) + throws LibGuestFSException; + } diff --git a/java/com_redhat_et_libguestfs_GuestFS.c b/java/com_redhat_et_libguestfs_GuestFS.c index 501e8d12..206f2dc3 100644 --- a/java/com_redhat_et_libguestfs_GuestFS.c +++ b/java/com_redhat_et_libguestfs_GuestFS.c @@ -4335,3 +4335,39 @@ Java_com_redhat_et_libguestfs_GuestFS__1tail_1n return jr; } +JNIEXPORT jstring JNICALL +Java_com_redhat_et_libguestfs_GuestFS__1df + (JNIEnv *env, jobject obj, jlong jg) +{ + guestfs_h *g = (guestfs_h *) (long) jg; + jstring jr; + char *r; + + r = guestfs_df (g); + if (r == NULL) { + throw_exception (env, guestfs_last_error (g)); + return NULL; + } + jr = (*env)->NewStringUTF (env, r); + free (r); + return jr; +} + +JNIEXPORT jstring JNICALL +Java_com_redhat_et_libguestfs_GuestFS__1df_1h + (JNIEnv *env, jobject obj, jlong jg) +{ + guestfs_h *g = (guestfs_h *) (long) jg; + jstring jr; + char *r; + + r = guestfs_df_h (g); + if (r == NULL) { + throw_exception (env, guestfs_last_error (g)); + return NULL; + } + jr = (*env)->NewStringUTF (env, r); + free (r); + return jr; +} + |