X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=java%2Fcom%2Fredhat%2Fet%2Flibguestfs%2FGuestFS.java;fp=java%2Fcom%2Fredhat%2Fet%2Flibguestfs%2FGuestFS.java;h=6adeb2118698636dff586bb7804fa18a22f53a72;hp=1d65581a266383e67e91731e610229fe63391885;hb=e492608f2f3809a824cb70ee03ff305964b69dd7;hpb=9a92446bcad09b492dee42dd5950bac67073fbea diff --git a/java/com/redhat/et/libguestfs/GuestFS.java b/java/com/redhat/et/libguestfs/GuestFS.java index 1d65581..6adeb21 100644 --- a/java/com/redhat/et/libguestfs/GuestFS.java +++ b/java/com/redhat/et/libguestfs/GuestFS.java @@ -3769,4 +3769,29 @@ public HashMap test0rhashtableerr () private native String _df_h (long g) throws LibGuestFSException; + /** + * estimate file space usage + *

+ * This command runs the "du -s" command to estimate file + * space usage for "path". + *

+ * "path" can be a file or a directory. If "path" is a + * directory then the estimate includes the contents of the + * directory and all subdirectories (recursively). + *

+ * The result is the estimated size in *kilobytes* (ie. + * units of 1024 bytes). + *

+ * @throws LibGuestFSException + */ + public long du (String path) + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("du: handle is closed"); + return _du (g, path); + } + private native long _du (long g, String path) + throws LibGuestFSException; + }