 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Mike King Guest
|
Posted: Tue Feb 22, 2005 2:43 pm Post subject: Named Pipes as Files |
|
|
From time to time, I find that it would be nice to pipe input into a GUI
application like one would do for a console application by using the '|'
character. Is it possible to create a named pipe and pull content from it
as if it were a file?
|
|
| Back to top |
|
 |
Bob Gonder Guest
|
Posted: Tue Feb 22, 2005 4:27 pm Post subject: Re: Named Pipes as Files |
|
|
Mike King wrote:
| Quote: | From time to time, I find that it would be nice to pipe input into a GUI
application like one would do for a console application by using the '|'
character. Is it possible to create a named pipe and pull content from it
as if it were a file?
|
What is it exactly, that you want to do?
'|' and '<' redirected stdin.
'>' redirected stdout.
Those pipes still work from the commandline.
An application can create pipes, and launch a sub program that will
then think those pipes are stdin and stdout.
See CreateProcess(), and in particular, the STARTUPINFO structure.
|
|
| Back to top |
|
 |
Mike King Guest
|
Posted: Tue Feb 22, 2005 4:47 pm Post subject: Re: Named Pipes as Files |
|
|
"Bob Gonder" <notbg (AT) notmindspring (DOT) invalid> wrote
| Quote: | Mike King wrote:
From time to time, I find that it would be nice to pipe input into a GUI
application like one would do for a console application by using the '|'
character. Is it possible to create a named pipe and pull content from it
as if it were a file?
What is it exactly, that you want to do?
'|' and '<' redirected stdin.
'>' redirected stdout.
Those pipes still work from the commandline.
An application can create pipes, and launch a sub program that will
then think those pipes are stdin and stdout.
See CreateProcess(), and in particular, the STARTUPINFO structure.
|
I was thinking about a pull-modal where the data is dynamic (probably
endless) so a file would not be the best solution. Just as an example, I
would like Notepad to be able to read from the pipe. So I would click
File -> Open then type in \.pipemynamedpipe and click Open. Notepad then
would show me some data that would be produce by a Windows Service or a
application that is running in the background.
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Tue Feb 22, 2005 7:34 pm Post subject: Re: Named Pipes as Files |
|
|
"Mike King" <emailMK (AT) excite (DOT) com> wrote
| Quote: | From time to time, I find that it would be nice to pipe input into
a GUI application like one would do for a console application by
using the '|' character. Is it possible to create a named pipe and
pull content from it as if it were a file?
|
Look at GetStdHandle() or GetStartupInfo() to get the process's STDIN pipe,
and then you can use that with ReadFile().
Gambit
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|