Documentation for routine write

Documentation for routine write, assembled from the following types:

class IO::Handle

From IO::Handle

(IO::Handle) method write

Defined as:

method write(IO::Handle:D: Blob:D $buf)

Binary writing; writes $buf to the filehandle. See print to write characters.

role IO::Socket

From IO::Socket

(IO::Socket) method write

method write(IO::Socket:D: Blob:D $buf)

Writes the supplied buffer to the socket, thus sending it to other end of the connection. The string version is method print.

Fails if the socket is not connected.

class IO::Socket::Async

From IO::Socket::Async

(IO::Socket::Async) method write

method write(Blob $b --> Promise)

Attempt to send the bytes in $b on the IO::Socket::Async that will have been obtained indirectly via connect or listen, returning a Promise that will be kept with the number of bytes sent or broken if there was an error sending.

class Proc::Async

From Proc::Async

(Proc::Async) method write

method write(Proc::Async:D: Blob:D $b:$scheduler = $*SCHEDULER)

Write the binary data in $b to the standard input stream of the external program.

Returns a Promise that will be kept once the data has fully landed in the input buffer of the external program.

The Proc::Async object must be created for writing (with, $path, @args)). Otherwise an X::Proc::Async::OpenForWriting exception will the thrown.

start must have been called before calling method write, otherwise an X::Proc::Async::MustBeStarted exception is thrown.