On Wed, 11 Nov 1998 [EMAIL PROTECTED] wrote:

> While this is not directly a Java question does anybody know of any
> library functions etc which will provide low level disk access to
> harddisks. i.e sector access etc.
> 
> I am looking at writing a Java class for providing direct access to a
> dedicated harddisk so that I can avoid some of the overhead of Java and
> normal filesystem based disk access.
> 
> Dave Atkinson
> 

I believe the ext2fs tools (e2fsck) has most of its disk access functions
in a library which you could use/look at ... but that would perhaps not be
low enough for you so how about: 
  int fd = open("/dev/hda", O_RDONLY);

and then:
  lseek()
  read()

from the block(s) you want. I don't know of any such library, but it won't
be that hard to write.

But if you want anything fancy like files, or co-existence with other
OS's/other partitions you're going to end up writing a new filesystem of
your own ...

Also, I'm not sure if /dev/hda access goes through the disk cache or if
you would loose that as well.


You could probably get very good performance increase without raw disk
access by rewriting some key routines in C. 

/Urban

---
Urban Widmark                           [EMAIL PROTECTED]
Svenska Test AB                         +46 90 71 71 23

Reply via email to