tcllux::chan(n) 1.0 tcllux_chan "tcllux::chan"

Name

tcllux::chan - TclLux chan

Table Of Contents

Synopsis

Description

The TclLux chan Tcl extension provides chan functionality.

COMMANDS

lux chan configure channelId ?name? ?val? ?...?

Configures the channelId. Options are -closeonexec and -handle. Returns an empty string when setting.

lux chan sync

System sync. Returns an empty string.

lux chan fsync channelId

Syncs the channelId. Returns an empty string.

lux chan fdatasync channelId

Datasyncs the channelId. Returns an empty string.

lux chan dup channelId

Duplicates the channelId to a new channelId. Returns the new channelId.

lux chan lock channelId ?name? ?val? ?...?

Locks a region of a file. Options and their defaults: -shared true -start 0 -length 0 -origin start -blocking false. This command accepts but ignores a -pidvar option. Returns a boolean true if the locking was successful, false otherwise.

lux chan unlock channelId ?name? ?val? ?...?

Unlocks a region of a file. Options and their defaults: -shared true -start 0 -length 0 -origin start -blocking false. This command accepts but ignores a -pidvar option. Returns a boolean true if the unlocking was successful, false otherwise.

lux chan canlock channelId ?name? ?val? ?...?

Checks if region of a file can be locked. Options and their defaults: -shared true -start 0 -length 0 -origin start. This command accepts but ignores a -blocking option. This command accepts a -pidvar option: -pidvar varname. If the region can't be locked and the -pidvar option is supplied, the pid of the process holding the lock will be stored in the variable specified by varname. Returns a boolean true if the region can be locked, false otherwise.

lux chan owner channelId ?owner?

Get or set the owner of a channelId. Returns an empty string when setting.

lux chan write channelId data

Writes data to channelId. Returns the number of bytes written to channelId.

See Also

fcntl(2), fsync(2), sync(2)

Keywords

chan, unix

Category

UNIX