Pike v8.0 release 1738

Module Stdio

Inheritance graph
_Stdio predef::Stdio 7.8::Stdio

Constant DATA_CHUNK_SIZE

final constant int Stdio.DATA_CHUNK_SIZE

Description

Size used in various places to divide incoming or outgoing data into chunks.


Constant NOTE_ATTRIB

constant int Stdio.NOTE_ATTRIB


Constant NOTE_DELETE

constant int Stdio.NOTE_DELETE


Constant NOTE_EXTEND

constant int Stdio.NOTE_EXTEND


Constant NOTE_LINK

constant int Stdio.NOTE_LINK


Constant NOTE_RENAME

constant int Stdio.NOTE_RENAME


Constant NOTE_REVOKE

constant int Stdio.NOTE_REVOKE


Constant NOTE_WRITE

constant int Stdio.NOTE_WRITE


Constant PROP_BIDIRECTIONAL

constant int Stdio.PROP_BIDIRECTIONAL

Description

The file is bi-directional.

See also

Stdio.File()->pipe()


Constant PROP_BUFFERED

constant int Stdio.PROP_BUFFERED

Description

The file is buffered (usually 4KB).

See also

Stdio.File()->pipe()


Constant PROP_IPC

constant int Stdio.PROP_IPC

Description

The file may be used for inter process communication.

See also

Stdio.File()->pipe()


Constant PROP_NONBLOCK

constant int Stdio.PROP_NONBLOCK

Description

The file supports nonblocking I/O.

See also

Stdio.File()->pipe()


Constant PROP_REVERSE

constant int Stdio.PROP_REVERSE

Description

Request reversed operation.

Used as argument to Stdio.File()->pipe(), when PROP_BIDIRECTIONAL hasn't been specified, to request the direction of the resulting pipe to reversed.

See also

Stdio.File()->pipe()


Constant PROP_SEND_FD

constant int Stdio.PROP_SEND_FD

Description

The Stdio.File object might support the Stdio.File()->send_fd() operation.

See also

Stdio.File()->pipe(), Stdio.File()->send_fd(), Stdio.File()->receive_fd()


Constant PROP_SHUTDOWN

constant int Stdio.PROP_SHUTDOWN

Description

The file supports shutting down transmission in either direction.

See also

Stdio.File()->close(), Stdio.File()->pipe()


Constant PROP_TTY

constant int Stdio.PROP_TTY

Description

The Stdio.File object supports tty operations.

Note

This constant is only present on platforms where pseudo tty (aka pty) operations are available, and may thus be used to detect whether such operations should be attempted.

See also

Stdio.File()->pipe()


Constant TCSADRAIN

constant string Stdio.TCSADRAIN

Description

Argument to Stdio.File()->tcsetattr().

Change after all output has been written.


Constant TCSAFLUSH

constant string Stdio.TCSAFLUSH

Description

Argument to Stdio.File()->tcsetattr().

Change after all output has been written, and empty the input buffers.


Constant TCSANOW

constant string Stdio.TCSANOW

Description

Argument to Stdio.File()->tcsetattr().

Change immediately.


Constant XATTR_CREATE

constant Stdio.XATTR_CREATE

Description

Used by setxattr function and method to signify a pure create, which will fail if the attribute already exists.


Constant XATTR_REPLACE

constant Stdio.XATTR_REPLACE

Description

Used by setxattr function and method to signify a replace, which will fail the the attribute does not already exists.


Constant __HAVE_OOB__

constant Stdio.__HAVE_OOB__

Description

Exists and has the value 1 if OOB operations are available.

Note

In Pike 7.5 and later OOB operations are always present.


Constant __HAVE_SEND_FD__

constant Stdio.__HAVE_SEND_FD__

Description

Support for sending of file descriptors over Stdio.File()->pipe() objects with PROP_SEND_FD capability is supported.

See also

Stdio.File()->send_fd(), Stdio.File()->receive_fd(), Stdio.File()->read(), Stdio.File()->write(), Stdio.File()->pipe()


Constant __OOB__

constant Stdio.__OOB__

Description

Implementation level of nonblocking I/O OOB support.

0

Nonblocking OOB support is not supported.

1

Nonblocking OOB works a little.

2

Nonblocking OOB almost works.

3

Nonblocking OOB works as intended.

-1

Unknown level of nonblocking OOB support.

This constant only exists when OOB operations are available, i.e. when __HAVE_OOB__ is 1.


Inherit _Stdio

inherit _Stdio : _Stdio


Typedef read_callback_t

local typedef function(mixed|void, string:int|void)|function(mixed|void, Buffer:int|void)|function(mixed|void:int|void) Stdio.read_callback_t

Description

The various read_callback signatures.

The string (or void) version is used when buffer mode (see set_buffer_mode) has not been enabled for reading.

The Buffer version is used when a Buffer has been enabled for reading.

In both cases the data is the newly arrived data, but in buffered mode data you did not fully read in the last read callback is kept in the buffer.


Variable stderr

FILE Stdio.stderr

Description

An instance of FILE("stderr"), the standard error stream. Use this when you want to output error messages.

See also

werror()


Variable stdin

FILE Stdio.stdin

Description

An instance of FILE("stdin"), the standard input stream. Use this when you want to read anything from the standard input. This example will read lines from standard input for as long as there are more lines to read. Each line will then be written to stdout together with the line number. We could use Stdio.stdout.write() instead of just write(), since they are the same function.

Example

int main() { int line; while(string s=Stdio.stdin.gets()) write("%5d: %s\n", line++, s); }


Variable stdout

FILE Stdio.stdout

Description

An instance of FILE("stdout"), the standatd output stream. Use this when you want to write anything to the standard output.

See also

write()


Typedef write_callback_t

local typedef function(mixed|void:int|void)|function(mixed|void, Buffer:int|void) Stdio.write_callback_t

Description

The various write_callback signatures.

The void version is used when buffer mode (see set_buffer_mode) has not been enabled for writing.

The Buffer version is used when a Buffer has been enabled for writing, add data to that buffer to send it.