Re: [racket] turning input-port into file-stream port

2013-11-13 Thread Vlad Kozin
For people who read mail as plain text and don't see hyperlinks, here they're in the order of appearance in the text: -- code being discussed http://pasterack.org/pastes/8580 -- source for process*/ports https://github.com/plt/racket/blob/master/racket/collects/racket/system.rkt -- answer by M.

Re: [racket] turning input-port into file-stream port

2013-11-13 Thread Vlad Kozin
> You have a synchronization problem. The copy-port within foo starts > reading the input file stream and hits EOF before the copy-port within > the separate thread starts writing to the file. David Pierson, you're absolutely right. This is exactly the problem with my hacky solution, which you

Re: [racket] turning input-port into file-stream port

2013-11-13 Thread Matthias Felleisen
On Nov 12, 2013, at 11:55 PM, David T. Pierson wrote: > Do you really need a file stream port and not just an input port? Vlad, are you looking for pipes? Racket Users list: http://lists.racket-lang.org/users

Re: [racket] turning input-port into file-stream port

2013-11-12 Thread David T. Pierson
On Tue, Nov 12, 2013 at 11:55:22PM -0500, David T. Pierson wrote: > On Nov 12, 2013, at 4:04 PM, Vlad Kozin wrote: > > Can somebody pls have a look at this code. I can't figure out why it > > doesn't work. Input is certainly seen inside the background thread > > that I spawn to pump data from one p

Re: [racket] turning input-port into file-stream port

2013-11-12 Thread David T. Pierson
On Nov 12, 2013, at 4:04 PM, Vlad Kozin wrote: > Can somebody pls have a look at this code. I can't figure out why it > doesn't work. Input is certainly seen inside the background thread > that I spawn to pump data from one port to another. But the main > thread seems to receive an empty port. Hi

Re: [racket] turning input-port into file-stream port

2013-11-12 Thread Vlad Kozin
I should also mention that doing this by creating a temporary file feels incredibly hacky if only because it never gets deleted. If anyone can think of a better pattern pls share. thanks --- Vlad Kozin On Nov 12, 2013, at 4:04 PM, Vlad Kozin wrote: > Hi all. > > Can somebody pls have a l

[racket] turning input-port into file-stream port

2013-11-12 Thread Vlad Kozin
Hi all. Can somebody pls have a look at this code. I can't figure out why it doesn't work. Input is certainly seen inside the background thread that I spawn to pump data from one port to another. But the main thread seems to receive an empty port. Thanks --- Vlad Kozin ___