Article View: borland.public.jbuilder.java.language
Article #18830Re: Q: How can I detect disk drives on local machine from App.?
From: Clint Brewer
Date: Tue, 21 Apr 1998 00:00
Date: Tue, 21 Apr 1998 00:00
45 lines
2815 bytes
2815 bytes
Jes Nielsen wrote: > > Hi > I am trying to get the directory structure on a local machine, to put in > a tree like the one found in the windows explore, and I just can't see any > solution to this at the moment. Maybe it's because of these long nights, or > the epoxy fumes from my boat building project. I have tried the > properties.class, but it only give me the user dir., classpath, current dir > .... not all the drivers, and the getenv method is deprecated, and when > looking in the source from the system.class all I see is a note about using > a -D parameter with the getProperties method, but this don't work either, > because getPropeties don't take any parameters. > I have tried the File.class, and found some of the drives by looping > through a alphabet array on my windows machine, but jdk can't find my disk > drive (a:), and Cd-rom drive (e:) without a disk in them, and this is not > very machine independent way of doing it, because Unix, Sinix(Siemens Unix), > Solaris, Mac.. uses other notations. > I know that I could use the FileDialog to navigate around in the > directory structure on any machines, but this is not the way I want use and > when I tried FileDialog in the swingset example I noticed that only the > current > drive was accessible. Why is this? Do I really have to pull my old dusty > Borland c/c++ development > tool out of garage and resolve to native methods to do this? > Could somebody point me in the right direction, or just slap me in the > face so I can wake up, because I can't see through the fog right now. > > TIA > Jes, Denmark Hello Jens, well I went and looked arround Javasoft's web site, and this appears to be a top 25 "Bug"/feature request there. I looked in the jdk1.2 documentation and didn't find anything there personally, it doesn't mean it's not there, but it seems that right now, there is no way for us to get acceptable accsess to those environment factors without relying on some native code. Go vote for the bug on JavaSoft if you haven't already, and hopefully future api's will let us do this. If you do find out how to do this, let us know on the newsgroup, it would be great! Best of luck, Clint Brewer Borland
Technical Details
Message-ID:
<353D440D.71C4@borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<6hgmc3$1hpg$1@news-inn.inet.tele.dk>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,a62dbcdf5f2cf13e X-Google-Attributes: gidf74b3,public From: Clint Brewer <supportinfo@borland.com> Subject: Re: Q: How can I detect disk drives on local machine from App.? Date: 1998/04/21 Message-ID: <353D440D.71C4@borland.com> X-Deja-AN: 346488294 Content-Transfer-Encoding: 7bit References: <6hgmc3$1hpg$1@news-inn.inet.tele.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: Borland International Newsgroups: borland.public.jbuilder.java.language