Page MenuHomeFreeBSD

flua: fbsd: allow stdout to be captured for exec() processes
ClosedPublic

Authored by kevans on May 27 2025, 12:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jun 7, 10:19 PM
Unknown Object (File)
Wed, May 20, 6:51 PM
Unknown Object (File)
May 12 2026, 8:32 AM
Unknown Object (File)
Apr 29 2026, 6:28 AM
Unknown Object (File)
Apr 29 2026, 6:22 AM
Unknown Object (File)
Apr 29 2026, 1:08 AM
Unknown Object (File)
Apr 29 2026, 1:04 AM
Unknown Object (File)
Apr 26 2026, 6:02 AM
Subscribers

Details

Summary

This allows us to do things like:

local fp = assert(fbsd.exec({"ls", "-l"}, true))
local fpout = assert(fp:stdout())

while true do
        local line = fpout:read("l")
        if not line then break end
        print("Read: " .. line)
end

fp:close()

The makeman lua rewrite will use it to capture make showconfig output
for processing.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable