Let me preface this with the notation that I am NOT a programmer, I
just monitor this list to assist our software/hardware engineers, as
well as learn a little bit more about the inner workings of our
upcoming products. I handle service, support and tech writing, so
look at my comments from that perspective.
As a tech support guy, I appreciate that you are trying to make the
system as bulletproof for the customer/user as you can, allowing
them to plug/unplug the USB stick at will.
However, I also don't deem it unreasonable to provide some sort of
visual/audio feedback that tells the users they absolutely CANNOT
remove insert the stick at that time.
>From my (limited) understanding of your question and Linux, unless
you're writing particularly large files or writing very frequently,
most write/read/sync operations to the USB stick should be
relatively quick. Something as simple as an LED that comes on
during a write/read operation would provide (to my mind) sufficient
feedback - IE, "Don't remove/insert the USB stick IF this light is
ON." As long as the light doesn't stay on long, or doesn't come on
so frequently as to make it impossible, asking the user to delay a
few seconds until a light goes out seems like a reasonable
compromise.
If you throw in some sort of "error trapping" routine that gives
negative (but not catastrophic) consequences (like an error message
or alarm) for failing to observe the LED, most people will quickly
learn the process (provided it's sufficiently documented).
This seems to be one of those cases where throwing a few extra
dollars to the circuit design (LED and associated circuitry) and the
operating instructions might be a better payoff than trying to
anticipate every stupid thing a user can do and spending the time
coding for all those stupid things. Because, sure enough, you won't
catch everyone of them.
Anyway, that's my $0.02.
Chris Heismann