They are simply numbers, and are always the same. STDOUT_FILENO is just to make it obvious that it is indeed a file.
When you start a process in a terminal, it gets three pre-opened files: standard input, standard output, and standard error. If you don't redirect them, they all talk directly to the terminal(stdin reads, stdout/stderr both write). However, the terminal itself can redirect them to wherever it pleases before the program is run ( which is how echo whatever > /dev/ttyUSB1 works -- the shell redirects the standard output of echo into /dev/ttyUSB1 )
Opening another file is easy however:
See man 2 open for further information.
Last edited by Corona688; 06-29-2012 at 06:51 PM..
what I'm trying to do is, I have an IMU I already program it using Arduino IDE, now I want to send a command to start streaming and another command to stop streaming data then I want to save that data into a text file. I run this code and it compile but it doesn't do anything I have no response from the IMU nor the terminal telling me something is wrong.
Moderator's Comments:
Code tags for code, please.
Last edited by Corona688; 06-30-2012 at 02:40 AM..
I was able to read the data. the problem that I have is when I want to save that data into a text file. When I execute the program it gave me this error "segmentation fault (core dumped)"
Dear,
Please help me to configure application clustering in linux ubuntu. Application is running apache server.
Please help
Jewel
---------- Post updated at 01:07 PM ---------- Previous update was at 12:48 PM ----------
linuxvirtualserver dot org
in this link i go there's three... (2 Replies)
Hello,
I'm a newbi to Unix and the last few weeks I have been trying to learn Unix through a book called Unix in 24 hours. I have tried advanced shell programming (that's what the chapter is called) today and what the excersise was all about was to create mylocate - a version of locate that is... (1 Reply)
Hello,
I am fairly new to ubuntu and have been learning linux using this distro. I am using Ubuntu 11.04 server.
Recently I added a new HD to the desktop.. however I know I need to mount it,
My question is how would I mount this disk? so I can use it as a drive?
Thanks
here are my... (5 Replies)
My PC (Esprimo, 3 yeas old) has one hard drive having 2 partitions C: (80 GB NTFS, XP) and D: (120 GB NTFS, empty) and and a 200 MB area that yet is not-partitioned.
I would like to try Ubuntu and to install Ubuntu on the not-partitioned area . The idea is to have the possibility to run... (7 Replies)