Question

I want to write an app. (web-based if possible) to copy an external HDD (already partitioned and containing data) to a like HDD with the same partitions-- does anyone think this would be possible with Java (Google App Engine? To convert Java app and run in web environment? Or likewise)

Thoughts on if anything thinks this would be possible in a certain language would be very helpful! PS. I think one of the biggest constraints would be where the data is going to land in between downloaded from one drive, and uploading to the next -- so for example I would need to establish a temp. directory on the users local internal HDD, transfer the contents of the external, than direct the final process of moving that data back out to the new external!

PS. I also know the brand, size of drive I will be using.

Was it helpful?

Solution

You shouldn't be trying to do this in a webapp, IMO. You will be blocked by sandbox security restrictions if you do this in an untrusted webapp / applet. And asking users to open up security to let your app do this is too dangerous ... for them.

Bulk file copying is best done using native OS tools.

OTHER TIPS

Well, in theory you can do it in Java as a Java Applet. But the Applet must be signed and the user must approve the security restrictions for the applet. It might be problematic copying the same hard drive of the OS if you are trying to do a bit by bit copy.

If you want a bit by bit copy of the OS disc, you must boot from an external CDROM/USB Device in order to preform the copy, and then the best language to write it will be C/C++.

If you are not searching for bit by bit copy, then you can just copy the files and that's can be accomplished even using JavaScript with shell.scripting object.

You didn't specified all the requirements, but (normally) you cannot do this in an Web app because:

  • You need access rights (ok, possible but...)
  • You need speed
  • The data is changing during the copy? If yes, then how? If the files are added / deleted then you need to register a watcher on drive (which means a concrete platform-specific API callback - very unlikely to be available in any Web language - Java, PHP etc.) to see what files needs to be copied after you scanned already the place in which the new file is added / deleted. If the files can be "anything" and are modified "randomly" during the copy process then you're in trouble. Because you can copy a file which is in an inconsistent state. This case is rare but it can happen. Especially if you want to mirror some kind of special HDD (eg. the main drive - the drive with the OS on it).

Also, there are other tricks involved when the files are changing on the source disk (different applications have different storage engines which have different patterns on saving a file).

If the disks are 'frozen' then you're ok. You can do a simple file copy (but also beware if you need to copy the file attributes, file streams etc.).

But if not, I'd advise you to buy a ready made application for this task like this one.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top