GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
PORCH(3lua) Lua Library Functions Manual PORCH(3lua)

porchLua library for porch(1)

local porch = require('porch')

‘PROGNAME’] = ‘bc’
 
])
 
 
 
 
 
 
 
 
 
[,argv...])
 
])
 
 
 
 
 
 
 
, linefilter)
 
 
 
)
 
)
 
 
)
 
)
 
)
 
)
 
)
 
 
 
)
 
]])
 
 
])
 
 
 
])
 

The porch module is the lua interface to the porch(1) program. The porch module exposes the following members directly:

‘PROGNAME’] = ‘bc’
Sets the global PROGNAME in the scripted environment. There is no limitation to what the caller may provide in the environment, it is expected that its main use will be to offer targeted methods to break out of the limited “sandbox” that the script runs in.
])
Run the script described by scriptfile. The caller may pass either a filename or an already-opened file stream. The porch.run_script function will return true if the script ran to completion without error, nil and an error if the script encountered a fatal error, or the value passed to the exit function that is provided in the scripted environment.
Completely resets the scripter state. This closes any process that may still be open, removes all actions specified by the current script, and resets the global timeout. The script file is only open long enough to read the script, so it does not need to be closed at reset time.

This happens at the beginning of the porch.run_script call, but one may want to release all resources held by porch after completion if it is not expected to be used again.

Sleep for at least the requested number of seconds. This is only exported because it is implemented for internal use, and some users could find it helpful to not need to import it from elsewhere.
[,argv...])
Spawns a new process described by the argument vector provided. This is an alternative to using porch.run_script, as most of the same functionality available to orch(5) scripts is also exposed via the process object. The argv0 name is subject to a standard PATH search, unless the name contains a “/” character.

See the below table for a description of the methods available for the process.

The porch.signals table maps signal names to their corresponding values. The keys to this table are signal names with a SIG prefix.

The porch.tty table exposes various tty options for the current system:

All of these are tables that map names to values that may be provided to the stty() function of a process: See your platform's termios documentation for more information on what the values represent. Only the lflag and cc tables are populated at the moment.

The following process operations are available on the object returned by porch.spawn:

])
Attempts to match pattern with the given matcher, which defaults to the Lua pattern matcher. Other matchers can be pulled from the porch.matchers.available table, which has the following keys:
The eof function behaves the same as it does in orch(5), except it does not take a callback as the second argument. Instead, it returns up to two values: a boolean to indicate whether the process has closed its end of the terminal device, and a wait status object if the process has terminated. The returned wait status object matches the object passed to the callback described for eof in orch(5). porch has no default timeout, so an omitted or nil timeout will result in the eof function waiting indefinitely for both EOF and the process to exit.
 
 
 
 
 
, linefilter)
 
 
 
 
 
 
 
)
Returns true if every signo specified is currently blocked.
)
Returns true if every signo specified is currently caught.
)
Returns true if every signo specified is currently ignored.
)
Returns true if every signo specified is currently unblocked.
 
 
)
 
]])
The process:stty function is provided for convenience, but there is some overlap with fuctionality provided by the process' process:term as described below.
This returns an object that represents the process terminal. The terminal object has the following method and properties:
)
Fetches the associated property from the terminal. The “field” requested may be one of:
  • “cc”
  • “cflag”
  • “iflag”
  • “lflag”
  • “oflag”

The requested values are returned in the same order that they are passed to term:fetch().

Updates the terminal with values specified in the table “fields”. The keys of the field table are expected to match the names of the fields that may be fetched above in term:fetch(). The values are the new value to assign the associated field. The process:stty() function described above may be more convenient to use when needing to simply enable or disable a single flag, as the fetch/update are done for you.
])
Get or set the size of the terminal. If both “width” and “height” are omitted or nil, the width and height are returned in that order. Otherwise, the specified elements are of the size are updated unless specified as nil.
])
 
 
 
])
 

All of these functions operate as described in orch(5), unless otherwise-indicated inline above.

porch(1), orch(5)

Kyle Evans ⟨kevans@FreeBSD.org⟩

June 4, 2025 FreeBSD 14.3-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.