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
F135157531: D50539.id156068.diff
Fri, Nov 7, 12:32 AM
Unknown Object (File)
Tue, Oct 28, 10:44 PM
Unknown Object (File)
Fri, Oct 17, 2:18 AM
Unknown Object (File)
Sun, Oct 12, 6:48 PM
Unknown Object (File)
Oct 5 2025, 5:30 AM
Unknown Object (File)
Oct 4 2025, 5:44 AM
Unknown Object (File)
Sep 24 2025, 1:25 AM
Unknown Object (File)
Sep 17 2025, 5:29 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