| Extracted from Pike v7.8 release 700 at 2013-06-08.

[Top]
Stdio

# Module Stdio

Constant PROP_SEND_FD

  `constant 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_REVERSE

  `constant 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_BIDIRECTIONAL

  `constant Stdio.PROP_BIDIRECTIONAL`

Description

  The file is bi-directional.

See also

  Stdio.File()->pipe()

Constant PROP_BUFFERED

  `constant Stdio.PROP_BUFFERED`

Description

  The file is buffered (usually 4KB).

See also

  Stdio.File()->pipe()

Constant PROP_SHUTDOWN

  `constant Stdio.PROP_SHUTDOWN`

Description

  The file supports shutting down transmission in either direction.

See also

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

Constant PROP_NONBLOCK

  `constant Stdio.PROP_NONBLOCK`

Description

  The file supports nonblocking I/O.

See also

  Stdio.File()->pipe()

Constant PROP_IPC

  `constant Stdio.PROP_IPC`

Description

  The file may be used for inter process communication.

See also

  Stdio.File()->pipe()

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.

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 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 DN_ACCESS

  `constant Stdio.DN_ACCESS`

Description

  Used in File.notify() to get a callback when files within a directory are accessed.

Constant DN_MODIFY

  `constant Stdio.DN_MODIFY`

Description

  Used in File.notify() to get a callback when files within a directory are modified.

Constant DN_CREATE

  `constant Stdio.DN_CREATE`

Description

  Used in File.notify() to get a callback when new files are created within a directory.

Constant DN_DELETE

  `constant Stdio.DN_DELETE`

Description

  Used in File.notify() to get a callback when files are deleted within a directory.

Constant DN_RENAME

  `constant Stdio.DN_RENAME`

Description

  Used in File.notify() to get a callback when files within a directory are renamed.

Constant DN_ATTRIB

  `constant Stdio.DN_ATTRIB`

Description

  Used in File.notify() to get a callback when attributes of files within a directory are changed.

Constant DN_MULTISHOT

  `constant Stdio.DN_MULTISHOT`

Description

  Used in File.notify() . If DN_MULTISHOT is used, signals will be sent for all notifications the program has registred for. Otherwise only the first event the program is listening for will be received and then the program must reregister for the events to receive futher events.

Inherit files

  inherit files : files

Constant DATA_CHUNK_SIZE

  `constant Stdio.DATA_CHUNK_SIZE`

Description

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

Constant TCSANOW

  `constant Stdio.TCSANOW`

Description

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

  Change immediately.

Constant TCSADRAIN

  `constant Stdio.TCSADRAIN`

Description

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

  Change after all output has been written.

Constant TCSAFLUSH

  `constant Stdio.TCSAFLUSH`

Description

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

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

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 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()

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);
        }