M a new user here and in java too, i working on application that need to copy some files from my one of folder to pen drive (removable disk) attached ,so how can i do that,actually i donot have any idea how it gonna implement so please help me out in this.
If I'm not mistaken, once you plug them into your computer's USB port and get them connected, they are just part of the file system. So you can just write to them like any other drive. If you're using Windows, for example, then your pen drive might be mapped to the E: drive, so you just write to files on the E: drive.
Did that answer your question, or is there more to it than that?
Joined: Oct 14, 2013
But How to Detect that drive??? and please tell me procedure/code to copy files please(as m a new user)
I don't know what you mean when you say "How to detect that drive?" It isn't your program's job to detect the drive. The operating system will do that and assign a drive letter (if it's Windows) or some other identification (if it's some other O/S). Perhaps you meant to ask how to find out which drive letter Windows assigned, or something like that?
sahil sethi wrote:But How to Detect that drive??? and please tell me procedure/code to copy files please(as m a new user)
Some time ago I wrote some code to detect the insert and removal of removable drives, you can find it here: http://www.keang.co.uk/drive.html NOte: This uses a basic polling approach and I haven't looked at later versions of Java to see if there is now a better way to go about this.