Need API for /dev/disk/by-uuid

From my Java Application I need to find all File system UUIDs. Is there any API that I can use? Or Is there any low level command that I can call? Kindly note that my application will run by an ordinary user(not super user).

I may completely misunderstandyour problem, but what is against

ls /dev/disk/by-uuid

It can be run by any user.

What about :

blkid

Oh, I see - only ordinary users…hmm then it is what hcvv recommends :slight_smile:

Sorry for the confusion. I want an Linux API (not command ls /dev/disk/by-uuid) which can provide me all the Filesystem UUIDs. This I need to build a Java based license specific to a system(Node lock).
I am already using MACID. In addition to this I want to attach Filesystem UUID to make more specific.

I can not program in Java, but this would be the first time I see a programming language that does not have either
a) an interface to a library to walk through the file structure or
b) an (POSIX defined) interface to the kernel to do the same or
c) an interface to run a command and obtain the standard output from that command.
I guessed for c), but in vain. I leave it now to the Java gurus.

hcvv wrote:

>
> I can not program in Java, but this would be the first time I see a
> programming language that does not have either
> a) an interface to a library to walk through the file structure or
> b) an (POSIX defined) interface to the kernel to do the same or
> c) an interface to run a command and obtain the standard output from
> that command.
> I guessed for c), but in vain. I leave it now to the Java gurus.
>
>

You can of course interface any C library and C++ or fortran library in java
by using JNI, that is what it is made for (whereas JNA is slightly more
comfortable) the posix libs are no exception to this, just to mention an
example.

Google is your friend and tells you examples how to use it (including a
posix example)
http://en.wikipedia.org/wiki/Java_Native_Access

Otherwise walk through the the folder /dev/disk/by-uuid with the java
builtin classes, it will be less painfull.

http://www.exampledepot.com/egs/java.io/GetFiles.html


openSUSE 11.2 64 bit | Intel Core2 Quad Q8300@2.50GHz | Gnome 2.28 | GeForce
9600 GT | 4GB Ram
openSUSE 11.3 64 bit | Intel Core2 Duo T9300@2.50GHz | Gnome 2.30 | Quadro
FX 3600M | 4GB Ram