Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

API to get Disk no and partition no  RSS feed

 
D Preethi
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Just wanted to know if there is a java API which can return me the disk number and the partition number if I give the volume name as input. Something like, if I give C:\ as input, it would return which disk number and partition number the drive is in.


Thanks in advance,
Preethi
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
disk and partition "numbers" are a very platform-specific concept; not only does Java not have anything built in to support this, but the question won't even be meaningful in all environments Java can run in. Anything dealing with that sort of low-level hardware information would need to be written in native code and accessed via the JNI.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!