Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JAVA any good?? for programs need low level access to HDD??

Status
Not open for further replies.

markmail

Programmer
Mar 29, 2007
3
Hi, Im in a process of building a program for an programing assignment, which requires to have low level access to HDD. I need my program to do the following:

-Read the hard drive bit by bit
-Acess boot sector to read information
-Read what's in the file header
-Read the file metafiles
-Read files in bits and l
-and perhaps read the alternative datasteam of a file

Is Java good for those kind of job?? how easy/hard is to program it with Java?? If Java is not the suitable for the job, what is the best option???

Im alright with JAVA & C, with some experience in VB and would like to try C#

appreciate any advices

thanks in advance

cheers
 
Sounds like a job for C, which I notice you are 'alright' with.

Tim
 
I didn't think user programs were allowed direct hardware access these days?

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Well, that's what 'drivers' are for. I don't know what's involved at this level but I would expect it to be a technically fiddly job. I presume users could write their own drivers if they knew enough to do so. I may be wrong.

Tim
 
what about reading a sector from one drive and write it to another drive??

basically im trying to write some sort of clonning program with additional tools to look at the drive's content (or the image cloned), therefore i will need a exact copy of the hard drive regardless of the file system and format...etc.

will C# work for the purpose??
 
VB doesn't sound like linux-os.
I could imagine reading most that stuff on linux, but not bit by bit.
Can you disable disk-caches from the os?
I guess you need at least a screwdriver to do that.

What is 'the alternative datasteam of a file'?

Now you're ok reading sektors?

I don't see what java can do for you here.

On linux, there is a tool dd, which allows to read an entire drive and you don't need java here.
Perhaps a linux-live-cd like knoppix or ubuntu is more suitable for you:
Code:
dd if=/dev/hda of=/mnt/some_bigger_drive/hda.image

here: you get GNU utilities for Win32, including dd.exe


don't visit my homepage:
 
im not 100% sure how alternative datastream works,
it exists on all NTFS, and is there to provide compatibility to with Mac file system. The system uses data forks to store the actually content, and resource forks to store attribute.


On windows system, alternative datastream is hidden, and won't be seem by normal file browsers. so u can hide a 100mb file in a 1kb file and the size will appear to be 1kb (the real file). basically the 100mb file is hidden behind the 1kb attribute

im doing it for a programing assignment, that's the reason why i do it~~

i guess i will give C++ a try~~

Mark
 
Given what you want to do, it will be using very low level calls. All modern OSs and languages abstract the disk access behind several layers of drivers and framework classes, so you never really get to see the disk blocks and sectors. Given that the whole point of Java is that it abstracts the platform environment as a virtual machine, it probably isn't the right way to go. Likewise, anything based on the .NET CLR like C# won't be much use for the same reasons.

If you aren't tied to using a Windows machine, you might be better off with Linux. As stefanwagner notes, there are open source utilities already available. You can use these[ol][li]As part of your solution[/li][li]To look at the source to see how to do it[/li][li]And as a way of verifying what you have written, to see if the results are correct.[/li][/ol].

Your requirements conflict - you seem to want to read the 'raw' disk, while at the same time have your program understand the file system structure that has been overlaid on it. This is a huge task.

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top