list root with jdk
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Monday, May 26, 2003 08:09 AM

// With the following code using JDK 1.4.01... I can get The  list root of a machine (C:/ , A:/ , D:/, ......) , but if  I use the first versions of JDK it is not possible.   File list[] = File.listRoots(); for ( int i = 0; i < list.length; i++ ) { File root = list[i]; if ( root.exists() ) System.out.println( root.getPath());     Can you help me to get a List Root of a Machine using the first versions of jdk too ? thanks.    More>>

// With the following code using JDK 1.4.01... I can get The  list root
of a machine (C:/ , A:/ , D:/, ......) , but if  I use the first versions of
JDK it is not possible.


 


File list[] = File.listRoots();



for ( int i = 0; i < list.length; i++ )

{

File root = list[i];



if ( root.exists() )



System.out.println( root.getPath());

 


 


Can you help me to get a List Root of a Machine using the first versions of jdk
too ?


thanks.    <<Less

Re: list root with jdk

Posted By:   Christopher_Schultz  
Posted On:   Monday, May 26, 2003 08:24 AM

If you know you'll always be on UNIX, you can assume there is always one root: /



On win32 or mac, I'm not sure this is possible.



-chris
About | Sitemap | Contact