I am new to C and would like to write a C program to accomplish the following:
I have an external 600GB USB disk device, Padlock Pro. The device, which can be seeing at:
has a number pad on it. It uses a maximum key of 16-digit, used to unlock the device.
If you plug the device to desktop the server does not know that it is connected until the user enters the security key. If you reboot, when the server comes up you need to reenter the key.
You might be asking by now what this has to do with C. Well, the potential problem with this device that I can see readily is the following. Once it is connected and recognized by the server, anyone with access to the server can also have access to the disk. I normally use the device connected to my laptop and so I rely on windows "security" keep the device from been accessed.
I would like to write a C program that:
- Periodically, say every 6 minutes, check for activities on that disk
- If the device has not been active during that period, 6 minutes, it should disconnect the device from the server
My questions are:
- How do I access, from a C program, a USB port
- Since the drive might change, how can I determine that I am on the correct device
- How can I check for activities on a USB without checking dor files updated, which can take a long time
- How do I disconnec the drive if no activity is detected.
I'm sorry for the length of this note and Thank you for your help!