-
|
Hi, Janet newbie here. Just trying to work out how to interact with a subprocess. As a toy example, I figure I should be able to spawn My attempt: I suppose the problem is there at the beginning with Where am I going wrong? My Janet version is Janet 1.17.1-meson macos/x64 Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 13 comments 1 reply
-
|
Looking at the test suite for an example, perhaps instead of |
Beta Was this translation helpful? Give feedback.
-
|
Unfortunately, I get the same: This is on a Linux box. |
Beta Was this translation helpful? Give feedback.
-
|
Possibly relevant: https://unix.stackexchange.com/questions/613117/cat-resource-temporarily-unavailable |
Beta Was this translation helpful? Give feedback.
-
|
Changing |
Beta Was this translation helpful? Give feedback.
-
|
I think cat won't work... From stackexchange:
Janet's pipes are non-blocking, but |
Beta Was this translation helpful? Give feedback.
-
|
On a related note, I've been trying out: I wonder if there is a way to get that to work on non-Linux... |
Beta Was this translation helpful? Give feedback.
-
|
Thanks, that seems to be echoed here. |
Beta Was this translation helpful? Give feedback.
-
|
Oddly enough, I wonder how often one would encounter programs that expect blocking read/write on stdin/stdout/stderr, and if such should be something that's supported. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @llmll and @sogaiu for your input on this. My actual use case was to run a couple of queries against MySQL database. Rather than setting up bindings to the MySQL client library, I thought it would be easier to just pipe in a query to the If there is no way to pipe data directly to/from the subprocess, I can probably get away with using temporary files to store input and output and invoke
If this is something that is wanted, I'd be interested in helping out .. I have experience with C, new to Janet. |
Beta Was this translation helpful? Give feedback.
-
|
May be it's worth trying with the |
Beta Was this translation helpful? Give feedback.
-
|
Ah, I forgot, there is also So depending on what you want to do precisely, may be that could work? |
Beta Was this translation helpful? Give feedback.
-
Yes that does the trick, good enough for my purposes for now - thanks! |
Beta Was this translation helpful? Give feedback.
-
|
Ok, this looks like a bug, and I have fixed it in 0774e79. I will create a bug to reference this discussion for tracking purposes. |
Beta Was this translation helpful? Give feedback.
Ok, this looks like a bug, and I have fixed it in 0774e79.
I will create a bug to reference this discussion for tracking purposes.