473,322 Members | 1,408 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Return stdin to keyboard

Hello.

Is it possible to return stdin to keyboard after redirecting it? For
example after command "myprogram.exe < data.txt", when I finish reading
from file I would like to be able to use keyboard. How is it done in
"more" command?

Thanks.

--
Wodny
Jul 23 '05 #1
2 1840
Wodny wrote:
Is it possible to return stdin to keyboard after redirecting it?
If it's possible to redirect stdin once, it should be possible to re-
redirect it, don't you think?
For
example after command "myprogram.exe < data.txt", when I finish reading
from file I would like to be able to use keyboard. How is it done in
"more" command?


I don't know about 'more', but it's quite possible that it has to use
OS-specific means of reading from the keyboard (or TTY or whatever is
there). Try an OS-specific newsgroup.

V
Jul 23 '05 #2
Victor Bazarov wrote:
Wodny wrote:
Is it possible to return stdin to keyboard after redirecting it?


If it's possible to redirect stdin once, it should be possible to re-
redirect it, don't you think?


I do think so, but I don't know how. Because the first redirection is
done by the console and the second one by the program.
For
example after command "myprogram.exe < data.txt", when I finish
reading from file I would like to be able to use keyboard. How is it
done in "more" command?

[...] it's quite possible that it has to use
OS-specific means of reading from the keyboard (or TTY or whatever is
there). Try an OS-specific newsgroup.


I will do so.

Thank You.

--
Wodny
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: gc | last post by:
I was having trouble getting fgets to read a string from stdin, it was reading a '\n' already in the buffer. Someone told me to rewind stdin before calling fgets. It works, but is it permissible?
23
by: herrcho | last post by:
What's the difference between STDIN and Keyboard buffer ? when i get char through scanf, i type in some characters and press enter, then, where do the characters go ? to STDIN or Keyboard...
11
by: Darklight | last post by:
is this correct or incorrect i just read the post below before posting this: In fflush(stdin), what happens to flushed data? this program is taken from sams teach yourself c in 21 days /*...
11
by: David Warner | last post by:
Greetings! I need to write some C code that will decide between either reading from stdin or take a file name from argv and process it. The program needs to work like all of the typical unix...
9
by: kernelxu | last post by:
hi, everyone. now, I'am confused on such a problem: function setbuf(stdin, NULL) or setvbuf(stdin, NULL, _IONBF, 0) can set the stadard input stream unbuffered. however, why does my program...
3
by: srbstar | last post by:
Can a program detect if it's stdin is coming from keyboard input vs. being redirected from a file? If it's from a file, I want to fputs() the text. But if it's from the keyboard, I won't...
30
by: sajjanharudit | last post by:
i need to check the stdin, repeatedly for an input form the keyboard, with out prompting the user to press a key or without returning pressed key on screen.. now the problem is that if i use...
18
by: Seeker | last post by:
I essentially copied this program from K&R: #include <stdio.h> #include <stdlib.h> int main() { int c;
0
by: JohnLongHorn97 | last post by:
Hello everyone, I would like to write a script that will read several ascii characters directly into the STDIN, so it will be like I pressed these values in my keyboard, in another window. for...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.