To avoid using a native method, it may be simpler to use Runtime.exec( ) to do a DIR /t:a <dir_name>, then catch and parse the output.
It will probably look a bit like this:
I haven't compiled and run this, but it's there abouts. Certainly quite easily doable. Hope it helped.
edit: wrong way round
[This message was edited by ssmith on January 09, 2002 at 18:14.]
It will probably look a bit like this:
code:<HR>Code:String dir = "c:/";<P>Process process = Runtime.exec( "dir /t:a " + dir ); BufferedReader reader = new BufferedReader( new InputStreamReader( process.getInputStream( ) ) ); process.waitFor( );<P>String lineIn = null; while( null != ( lineIn = reader.readLine( ) ) ) { // parse the strings coming in }<P>
I haven't compiled and run this, but it's there abouts. Certainly quite easily doable. Hope it helped.
edit: wrong way round
[This message was edited by ssmith on January 09, 2002 at 18:14.]