X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=java%2Fcom%2Fredhat%2Fet%2Flibguestfs%2FGuestFS.java;h=64b0802bf2ccc577c2cc55949f6ccca9322d19e5;hp=c664801db518bb4302a6eb5aa914e1a619443cfc;hb=f450ce75b754fb869b34433c0126f7bb592b141b;hpb=62ccc07e744d5ebfb45d9344827d36f9f61699f4 diff --git a/java/com/redhat/et/libguestfs/GuestFS.java b/java/com/redhat/et/libguestfs/GuestFS.java index c664801..64b0802 100644 --- a/java/com/redhat/et/libguestfs/GuestFS.java +++ b/java/com/redhat/et/libguestfs/GuestFS.java @@ -3569,4 +3569,58 @@ public HashMap test0rhashtableerr () private native String _mkdtemp (long g, String template) throws LibGuestFSException; + /** + * count lines in a file + *

+ * This command counts the lines in a file, using the "wc + * -l" external command. + *

+ * @throws LibGuestFSException + */ + public int wc_l (String path) + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("wc_l: handle is closed"); + return _wc_l (g, path); + } + private native int _wc_l (long g, String path) + throws LibGuestFSException; + + /** + * count words in a file + *

+ * This command counts the words in a file, using the "wc + * -w" external command. + *

+ * @throws LibGuestFSException + */ + public int wc_w (String path) + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("wc_w: handle is closed"); + return _wc_w (g, path); + } + private native int _wc_w (long g, String path) + throws LibGuestFSException; + + /** + * count characters in a file + *

+ * This command counts the characters in a file, using the + * "wc -c" external command. + *

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