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, Oct 5, 5:30 AM
Unknown Object (File)
Sat, Oct 4, 5:44 AM
Unknown Object (File)
Wed, Sep 24, 1:25 AM
Unknown Object (File)
Wed, Sep 17, 5:29 AM
Unknown Object (File)
Sun, Sep 14, 8:56 AM
Unknown Object (File)
Sep 1 2025, 2:56 PM
Unknown Object (File)
Aug 31 2025, 7:49 AM
Unknown Object (File)
Aug 21 2025, 1:48 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