Re: hard drive access
- Posted by jimcbrown (admin) Nov 19, 2013
- 1741 views
Has anyone written a Euphoria include for accessing harddrives at sector level by specifying the LBA?
Because i have maybe a dozen files of 15Gbytes or more, and if i would gets() them in and then write them back out with the records aligned on sector boundries, i could then access each record in the file as datafile[sectornumber].
If anyone has tried this, and found it's better to use seek() in (whatever)byte increments, chime in too.
I don't think one would need a special include to do this.
To move to a particular LBA address, just use seek() in 512 byte increments. I think the formula looks like
seek_position = (LBA_address + 1) * 512
On nix, one opens the file "/dev/sda" or etc using the normal open() routine. On Windoze, the file to open is different, but pretty much everything else is the same. (You need root/admin privs to be able to do so, obviously.) It's all straightforward if you know what you are doing. (Though I've only tried this on Linux/GNU....)
added: articles which have the file name to open on windoze
http://stackoverflow.com/questions/2108313/how-to-access-specific-raw-data-on-disk-from-java