Robert Ngo <ro*******@163.com> wrote:
how to read from serial port with c on a linux server, the serail port is
connect to a card reader. The information will then be save in a postgre
database.
Unless you treat the device file for the serial port like a normal file
you can't use the standard C functions like fopen(), fread() etc. -
and since they don't allow the fine grained control over what is going
on you will usually need Linux specific, nonstandard functions. But
these aren't discussed here but in e.g. comp.os.linux.development.apps
(but if you ask there it would probably be prudent to ask a question
and not only more or less state your intentions because otherwise your
chances of getting helpful relies won't be that good). Moreover, how to
deal with databases is also something for which no standard C functions
exist, again you will need some extensions which also are off-topic
here. Since I don't know about any newsgroup dealing with Postgresql
I guess reading a bit in
http://www.physiol.ox.ac.uk/Computin...rogrammer.html
(which was the first hit Google turned up for "postgres C library) might
get you started. As far as I can see there also seems to be a mailing
list devoted to the topic.
Regards, Jens
--
\ Jens Thoms Toerring ___
Je***********@physik.fu-berlin.de
\__________________________
http://www.toerring.de