Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > How to chek if USB port is mounted in linux?

Reply
Thread Tools

How to chek if USB port is mounted in linux?

 
 
KimHoon
Guest
Posts: n/a
 
      09-19-2003
I want to know how to check if USB port is mounted...

I programmed some sources , which run to read data-files in usb storage.

And I have no input systems; no keyboard, no mouse, no touchpad screen...

I want immediately to stop running my program when I disconnect USB port
physically.

In this point, the program is checking in every 3 seconds whether USB is
mounted.

If USB is connected and mounted, programs continue running and if not, they
must be stoped automatically.

Everything is OK but checking USB port.

How can I program in C?

Please show me the sources in C...

Thanks with God!


 
Reply With Quote
 
 
 
 
Joona I Palaste
Guest
Posts: n/a
 
      09-19-2003
KimHoon <(E-Mail Removed)> scribbled the following:
> I want to know how to check if USB port is mounted...


That can't be done in ISO standard C. Please ask in a newsgroup
dedicated to your own implementation.

--
/-- Joona Palaste ((E-Mail Removed)) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/
"How come even in my fantasies everyone is a jerk?"
- Daria Morgendorfer
 
Reply With Quote
 
 
 
 
Clemens Auer
Guest
Posts: n/a
 
      09-19-2003
you can check for the specific files in the /proc file system od also in
the /sys filesystem on 2.6 kernels ..
or you play a bit with iocntrl ind it should provide the same ..

btw.
whe 2.6serie of the linux kernel provides a feature that does exactly
the same you want to do.. somewhere in the security chapter of the
kernel config...
so maybe look at that piece of code ..


On Fri, 19 Sep 2003 15:15:37 +0900
"KimHoon" <(E-Mail Removed)> wrote:

> I want to know how to check if USB port is mounted...
>
> I programmed some sources , which run to read data-files in usb
> storage.
>
> And I have no input systems; no keyboard, no mouse, no touchpad
> screen...
>
> I want immediately to stop running my program when I disconnect USB
> port physically.
>
> In this point, the program is checking in every 3 seconds whether USB
> is mounted.
>
> If USB is connected and mounted, programs continue running and if not,
> they must be stoped automatically.
>
> Everything is OK but checking USB port.
>
> How can I program in C?
>
> Please show me the sources in C...
>
> Thanks with God!
>
>

 
Reply With Quote
 
LibraryUser
Guest
Posts: n/a
 
      09-19-2003
*** Rude and evil topposting corrected ***

Clemens Auer wrote:
> "KimHoon" <(E-Mail Removed)> wrote:
>
> > I want to know how to check if USB port is mounted...
> >
> > I programmed some sources , which run to read data-files in usb
> > storage.
> >
> > And I have no input systems; no keyboard, no mouse, no touchpad
> > screen...
> >

.... snip ...
>
> you can check for the specific files in the /proc file system od
> also in the /sys filesystem on 2.6 kernels ..
> or you play a bit with iocntrl ind it should provide the same ..
>
> btw.
> whe 2.6serie of the linux kernel provides a feature that does
> exactly the same you want to do.. somewhere in the security
> chapter of the kernel config...
> so maybe look at that piece of code ..


There are two major problems with your reply. First, it is
topposted, which is not condoned in c.l.c. Second, it is
off-topic, as was the original query. Such queries should be
answered only with redirection to an appropriate group. The
reason is that erroneous responses will not get corrected (there
is nobody here to do it, at least in theory), and that such
responses encourage more off-topic traffic.

--
Replies should be to the newsgroup
Chuck Falconer, on vacation.
 
Reply With Quote
 
Jack Klein
Guest
Posts: n/a
 
      09-20-2003
On Fri, 19 Sep 2003 08:45:31 +0200, Clemens Auer <(E-Mail Removed)>
wrote in comp.lang.c:

> you can check for the specific files in the /proc file system od also in
> the /sys filesystem on 2.6 kernels ..
> or you play a bit with iocntrl ind it should provide the same ..


This is comp.lang.c, not a Linux newsgroup. Please don't post such
off-topic gibberish here. There is no such thing as a "/sys" or
"/proc" file system in the C language.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
chek where mouse is sandip.dhamapurkar@gmail.com Javascript 7 04-05-2006 07:56 AM
Synthesis erron for "bit'val" attribute....plz chek Dunce by face... VHDL 1 01-19-2006 03:10 PM
Can RangeValidator Chek emtpy value ad ASP .Net 1 07-15-2005 11:19 AM
Glue for sticking front mounted USB2.0 and Firewire ports to PC case? M Computer Support 10 12-07-2004 07:50 AM



Advertisments