POV-Ray : Newsgroups : povray.off-topic : Something new every day Server Time
6 Sep 2024 17:17:42 EDT (-0400)
  Something new every day (Message 1 to 10 of 20)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Invisible
Subject: Something new every day
Date: 7 Nov 2008 09:08:44
Message: <49144bec$1@news.povray.org>
So check this out: Apparently piping works on Windoze.

I knew redirecting the three standard handles works on Windoze, but I 
had no idea you could actually pipe data directly from one program to 
another. I thought only Unix could do that particular trick.


Post a reply to this message

From: Eero Ahonen
Subject: Re: Something new every day
Date: 7 Nov 2008 11:08:46
Message: <4914680e@news.povray.org>
Invisible wrote:
> So check this out: Apparently piping works on Windoze.
> 
> I knew redirecting the three standard handles works on Windoze, but I
> had no idea you could actually pipe data directly from one program to
> another. I thought only Unix could do that particular trick.

Welcome to world of PC's. IIRC piping worked even on MS-DOS (eg. type
autoexec.bat|more).

-Aero


Post a reply to this message

From: Mueen Nawaz
Subject: Re: Something new every day
Date: 7 Nov 2008 11:39:44
Message: <49146f50@news.povray.org>
Eero Ahonen wrote:
> Invisible wrote:
>> So check this out: Apparently piping works on Windoze.
>>
>> I knew redirecting the three standard handles works on Windoze, but I
>> had no idea you could actually pipe data directly from one program to
>> another. I thought only Unix could do that particular trick.
> 
> Welcome to world of PC's. IIRC piping worked even on MS-DOS (eg. type
> autoexec.bat|more).

	Yep. Been there since forever.

-- 
Inoculatte: To take coffee intravenously when you are running late.


                    /\  /\               /\  /
                   /  \/  \ u e e n     /  \/  a w a z
                       >>>>>>mue### [at] nawazorg<<<<<<
                                   anl


Post a reply to this message

From: Darren New
Subject: Re: Something new every day
Date: 7 Nov 2008 12:45:29
Message: <49147eb9$1@news.povray.org>
Eero Ahonen wrote:
> Welcome to world of PC's. IIRC piping worked even on MS-DOS (eg. type
> autoexec.bat|more).

Under DOS, since only one thing ran at a time, this didn't actually 
"pipe" the data. It was just a shortcut for
   type autoexec.bat >tempfile
   more <tempfile

You had to wait for the first program to finish, and you had to have 
enough disk space, before the second would start.

Pretty much every MS OS since Win3 at least has had actual pipes, tho. I 
think the command.com under Win3 still used the tempfile stuff, but the 
OS had a "make a pipe" call in it.

-- 
Darren New / San Diego, CA, USA (PST)


Post a reply to this message

From: Warp
Subject: Re: Something new every day
Date: 7 Nov 2008 16:25:10
Message: <4914b236@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> Eero Ahonen wrote:
> > Welcome to world of PC's. IIRC piping worked even on MS-DOS (eg. type
> > autoexec.bat|more).

> Under DOS, since only one thing ran at a time, this didn't actually 
> "pipe" the data. It was just a shortcut for
>    type autoexec.bat >tempfile
>    more <tempfile

  Yes. The difference is whether a program can programmatically create
pipes or not. For example in unix systems (and probably in Windows as
well) a program can create a named pipe, after which it can write data
to it, and then another program can read the data from it. It works like
a data queue between programs. In fact, more than one program can write
to the pipe (although if two programs do so at the same time, it's not
guaranteed in which order the data will come out).

-- 
                                                          - Warp


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Something new every day
Date: 7 Nov 2008 16:46:07
Message: <4914b71f@news.povray.org>
Warp wrote:
>   Yes. The difference is whether a program can programmatically create
> pipes or not. For example in unix systems (and probably in Windows as
> well) a program can create a named pipe, after which it can write data
> to it, and then another program can read the data from it. It works like
> a data queue between programs. In fact, more than one program can write
> to the pipe (although if two programs do so at the same time, it's not
> guaranteed in which order the data will come out).

However Windows named pipes aren't part of the filesystem. Unix's mkfifo is
*very* useful.


Post a reply to this message

From: Darren New
Subject: Re: Something new every day
Date: 7 Nov 2008 16:52:48
Message: <4914b8b0@news.povray.org>
Warp wrote:
> For example in unix systems (and probably in Windows as
> well) a program can create a named pipe,

Yep. And Windows has different kinds of "pipes" as well, in addition to 
the usual stream-of-bytes stuff. I'm talking about message queues and 
stuff like that.  Windows uses named pipes for all kinds of things, like 
talking to the graphics system, over the network, etc etc.

-- 
Darren New / San Diego, CA, USA (PST)


Post a reply to this message

From: Darren New
Subject: Re: Something new every day
Date: 7 Nov 2008 16:53:50
Message: <4914b8ee$1@news.povray.org>
Nicolas Alvarez wrote:
> However Windows named pipes aren't part of the filesystem. 

Yes they are. You just have to use \\?\.... syntax to get at them. Why 
do you think they're *named* pipes?

-- 
Darren New / San Diego, CA, USA (PST)


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Something new every day
Date: 7 Nov 2008 17:32:16
Message: <4914c1f0@news.povray.org>
Darren New wrote:
> Yes they are. You just have to use \\?\.... syntax to get at them. Why
> do you think they're *named* pipes?

Most programs I have tried don't work with that syntax. I think it only
works if you use the Windows API directly, and not stuff like fopen...


Post a reply to this message

From: Darren New
Subject: Re: Something new every day
Date: 7 Nov 2008 17:38:42
Message: <4914c372$1@news.povray.org>
Nicolas Alvarez wrote:
> Most programs I have tried don't work with that syntax. I think it only
> works if you use the Windows API directly, and not stuff like fopen...

Not surprisingly, if you use the UNIX interface libraries to access 
Windows juju, no, it might not work.  That whole "lowest common 
denominator" type thing doesn't really work anywhere once you get 
sophisticated about things.   :-)

But yes, I have used named pipes in Unix before, and they can be 
surprisingly handy for some things. Kind of annoying in that (at least 
back then) the locking/exclusion semantics made things difficult. 
Difficult enough I wound up writing a socket listener instead and 
replaced the I/O stuff with libraries to talk to the sockets.

-- 
Darren New / San Diego, CA, USA (PST)


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.