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
F163238608: D50539.id156068.diff
Tue, Jul 21, 8:06 AM
Unknown Object (File)
Mon, Jul 20, 11:16 AM
Unknown Object (File)
Sat, Jul 18, 3:55 PM
Unknown Object (File)
Thu, Jul 16, 5:50 PM
Unknown Object (File)
Mon, Jul 6, 3:43 AM
Unknown Object (File)
Fri, Jul 3, 8:49 AM
Unknown Object (File)
Mon, Jun 29, 3:36 PM
Unknown Object (File)
Mon, Jun 29, 12:35 PM
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