Hi,
For a small Windows desktop application I needed a simple way to check
for the existence and drive names of cdrom drives. My immediate
inclination was to iterate through an array returned by list.Roots()
using File.exists() with empty drives as the test. But I seem to recall
that problems have been reported where exists() would'nt,in the case of
Win XP or one of its SP's, work as I expected
An alternative would be to use a WIM/script function, but again as I
understand it, accomodating the various flavours of Windows is not
entirely without problems.
As a relative novice I'm fumbling my way through this, so any comments
would be welcome as to the most reliable route to persue. I'm not
looking for example code, just a prod in the right direction.
As an aside, from what I read the emergence of Java 7 (Dolphin) might
possibly (MS permitting) put an end to this type of problem.
Don Hamilton.
Chris Smith - 05 Jun 2006 02:41 GMT
> For a small Windows desktop application I needed a simple way to check
> for the existence and drive names of cdrom drives. My immediate
> inclination was to iterate through an array returned by list.Roots()
> using File.exists() with empty drives as the test. But I seem to recall
> that problems have been reported where exists() would'nt,in the case of
> Win XP or one of its SP's, work as I expected
Indeed. The only reliable way to do what you want is to use Windows-
specific APIs, which means writing code in some other language than
Java. The interface between your non-Java code and the Windows
application would probably be JNI, although you could use something
else, such as standard I/O streams or a TCP socket, if you want to avoid
incorporating a C or C++ build environment into your project (assuming
you don't use C or C++ to write the API in the first place).

Signature
Chris Smith - Lead Software Developer / Technical Trainer
MindIQ Corporation