X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=java%2Fcom%2Fredhat%2Fet%2Flibguestfs%2FGuestFS.java;h=e8f36ff4246a0d13a76efee78d5f08ad19f64c2c;hb=5186251f8f681f2ebb028423bb49a748861fd11e;hp=cc94a98789806eae6f352bb9d3c1ae3e276c4ab0;hpb=f20854ec61eef1aea313920f0cf193a78c1a9219;p=libguestfs.git diff --git a/java/com/redhat/et/libguestfs/GuestFS.java b/java/com/redhat/et/libguestfs/GuestFS.java index cc94a98..e8f36ff 100644 --- a/java/com/redhat/et/libguestfs/GuestFS.java +++ b/java/com/redhat/et/libguestfs/GuestFS.java @@ -29,6 +29,7 @@ import com.redhat.et.libguestfs.LV; import com.redhat.et.libguestfs.Stat; import com.redhat.et.libguestfs.StatVFS; import com.redhat.et.libguestfs.IntBool; +import com.redhat.et.libguestfs.Dirent; /** * The GuestFS object is a libguestfs handle. @@ -4054,4 +4055,30 @@ public HashMap test0rhashtableerr () private native int _umask (long g, int mask) throws LibGuestFSException; + /** + * read directories entries + *

+ * This returns the list of directory entries in directory + * "dir". + *

+ * All entries in the directory are returned, including "." + * and "..". The entries are *not* sorted, but returned in + * the same order as the underlying filesystem. + *

+ * This function is primarily intended for use by programs. + * To get a simple list of names, use "g.ls". To get a + * printable directory for human consumption, use "g.ll". + *

+ * @throws LibGuestFSException + */ + public Dirent[] readdir (String dir) + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("readdir: handle is closed"); + return _readdir (g, dir); + } + private native Dirent[] _readdir (long g, String dir) + throws LibGuestFSException; + }