473,503 Members | 1,650 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Terminal input and pipe - possible to have both?

Hi,
I just started working on a simple 'more' version.
I use it like this:
cat blabla.txt | more

Here is my problem:
Since more gets its input through a pipe I can't use stdin for
keyboard input anymore and thus can't scroll with space and return.

How can I have one filestream for the pipe and another for regular
keyboard input?
Is this possible?

Nov 4 '07 #1
6 2406
In article <11*********************@o3g2000hsb.googlegroups.c om>,
ko********@gmail.com <ko********@gmail.comwrote:
>Hi,
I just started working on a simple 'more' version.
I use it like this:
cat blabla.txt | more

Here is my problem:
Since more gets its input through a pipe I can't use stdin for
keyboard input anymore and thus can't scroll with space and return.

How can I have one filestream for the pipe and another for regular
keyboard input?
Is this possible?
Not in standard C...

IOW:

Off topic. Not portable. Cant discuss it here. Blah, blah, blah.

--
Useful clc-related links:

http://en.wikipedia.org/wiki/Aspergers
http://en.wikipedia.org/wiki/Clique
http://en.wikipedia.org/wiki/C_programming_language

Nov 4 '07 #2
Ok,
but is there a function that doesn't echo everything I type?
Because when I hit enter I get 2 newlines (the one at the end of the
line and my input).

Nov 4 '07 #3
ko********@gmail.com wrote:
Hi,
I just started working on a simple 'more' version.
I use it like this:
cat blabla.txt | more

Here is my problem:
Since more gets its input through a pipe I can't use stdin for
keyboard input anymore and thus can't scroll with space and return.

How can I have one filestream for the pipe and another for regular
keyboard input?
Is this possible?
This is topical to <news:comp.unix.programmer>

Nov 4 '07 #4
In article <11*********************@19g2000hsx.googlegroups.c om>,
ko********@gmail.com <ko********@gmail.comwrote:
>Ok,
but is there a function that doesn't echo everything I type?
Because when I hit enter I get 2 newlines (the one at the end of the
line and my input).
Again, not in standard C, blah, blah, blah...

Nov 4 '07 #5
ko********@gmail.com wrote:
Ok,
but is there a function that doesn't echo everything I type?
Because when I hit enter I get 2 newlines (the one at the end of the
line and my input).
You need to use system specific mechanisms to do this. Find a group
specific for your system. Since you seem to be using a UNIX type system
<news:comp.unix.programmer>, as I suggested earlier, will be a better
group to ask these questions.

Nov 4 '07 #6
On Nov 4, 7:58 am, "kotzkro...@gmail.com" <kotzkro...@gmail.com>
wrote:
Hi,
I just started working on a simple 'more' version.
I use it like this:
cat blabla.txt | more

Here is my problem:
Since more gets its input through a pipe I can't use stdin for
keyboard input anymore and thus can't scroll with space and return.

How can I have one filestream for the pipe and another for regular
keyboard input?
Is this possible?
As mentioned, this is not standard C. You might try opening /dev/tty
and reading from that (this idea comes from The Unix Programming
Environment, I think by Thompson and Pike - I may be wrong about
that). On a DOS/Win environment, open the device "CON", it should
accomplish the same thing.

-- Marty (a newbie, so feel free to ignore me)
Nov 4 '07 #7

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

Similar topics

4
4053
by: flamesrock | last post by:
First, I'm very new to gui programming, so please go lightly on me :) Ok, so far I've settled on wxPython, and what I'd like to do as a first leap is *convert* a text program into a gui program....
16
2850
by: Justin Lazanowski | last post by:
Cross posting this question on the recommendation of an I have a .NET application that I am developing in C# I am loading information in from a dataset, and then pushing the dataset to a grid,...
4
9410
by: jas | last post by:
I have a basic client/server socket situation setup....where the server accepts a connection and then waits for commands. On the client side, I create a socket, connect to the server...then I...
1
4606
by: Zen | last post by:
From http://support.microsoft.com/kb/828956/ "Note Microsoft does not support the use of multiple versions of Microsoft Office on a Terminal Server. Coexistence is not supported on versions...
0
1523
by: Spiros | last post by:
Hi everybody I am creating an application using VC++ that runs on a terminal server with 30 end users. The end users will use thin clients as front end machines. The application consists of a main...
20
10808
by: Joel Hedlund | last post by:
Hi all! I use python for writing terminal applications and I have been bothered by how hard it seems to be to determine the terminal size. What is the best way of doing this? At the end I've...
4
2091
by: Chris | last post by:
Hi, I'm puzzled by some strange behavior when my Python/Tkinter application quits (on linux): the terminal from which I started Python is messed up. If start up python, then import the code...
7
2408
by: Captain Dondo | last post by:
I'm working on a terminal emulator for an embedded system. The key requirements are small size, code clarity, maintainability, and portability. We have machines that regularly see a service life...
4
1562
by: MykeAndrews | last post by:
If this topic is discussed in another post, I apologize. I was unable to find it but I'm struggling to come up with good key words to search for. My issue is this: I'm trying to create a "shell"...
0
7083
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7278
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7456
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5011
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3153
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1510
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.