Zulip Chat Archive

Stream: new members

Topic: IO.Process.output with stdin being a string?


Eduardo Ochs (Mar 12 2024 at 02:32):

Hi all! How do I tell IO.Process.output to run with its stdin being (piped from) a string? Or, more precisely: how do I write a function "tac" that receives a string, pipes it through /usr/bin/tac, and returns the output? Apparently the "def findLeanSysroot?" in Lake/Config/InstallPath.lean is a good starting point, and I would need to use IO.Process.Stdio.piped somewhere - but I am a newbie and I'm struggling with the details...

Eduardo Ochs (Mar 12 2024 at 02:38):

Note: I mentioned tac above just to discuss a minimal example, but my real objective is to use this thing here - luatree.lua - to draw 2D trees in ASCII art... here's a screenshot:

Eduardo Ochs (Mar 12 2024 at 02:39):

sshot.png


Last updated: May 02 2025 at 03:31 UTC