how to control a USB DISK?

Z

zyqnews

hello all,
I now have a simple project. It is to test the change of use disk,
when a new usb disk is plugged into the usb socket, the program will
copy a file to the usb disk, then disabled the usb disk to be pulled
out safely. I intend to make it with python. Does someone here get any
experiences about USB disk programming, and any suggestons ?
Thanks a lot.
 
O

Ola Natvig

hello all,
I now have a simple project. It is to test the change of use disk,
when a new usb disk is plugged into the usb socket, the program will
copy a file to the usb disk, then disabled the usb disk to be pulled
out safely. I intend to make it with python. Does someone here get any
experiences about USB disk programming, and any suggestons ?
Thanks a lot.
if you are using windows:

Perhaps you can use COM to detect the evenet of the disk beeing placed
in it's socket (i don't know if it's possible) and then jost copy the
file. I gues that the real problem are the detecting of the session
start and beeing able to disable the disk. I don't know which (if any)
COM service that can be used.

ola
 
R

Roland Heiber

Hi,

when you're under linux and a 2.6er kernel, take a look at hotplug, you
can configure it the way that your script gets executed whenever a
specific device is plugged in/out ...

HtH, Roland
 
G

Greg Fischer

I actually tried this last summer on linux and I think in order to
make it work right I had to use the hotplug features AND udev. I had
to use udev because I needed a specific mount path, otherwise it just
picked the next in the list if there was more than one drive.

I ended up skipping that project because it was a pain and I just
didnt have enough time. Allthough, I could write to usb drives.

Look into hotplug and udev, hopefully that gets you going.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top