class IO::Special

Represent a Standard I/O device

This provides a similar interface for the special standard input and output handles $*IN, $*OUT and $*ERR to that of IO::Path for regular files. It is typically returned by the path method of those handles so that they can be used interchangeably with the handles of regular files.

Methods

method new

method new(:$!what!)

The constructor has a single required named argument what that will be '<STDIN>', '<STDOUT>' or '<STDERR>' as appropriate. It is unlikely that you will ever need to construct one of these objects yourself however as it will be done for you when the special handles are initialised.

method WHICH

method WHICH(IO::Special:D: --> Str)

This returns a string which identifies the object.

method Str

method Str(IO::Special:D:)

This returns '<STDIN>', '<STDOUT>' or '<STDERR>' as appropriate.

method IO

method IO(IO::Special:D: --> IO::Special)

This returns the IO::Special object, it is provided for conformance to the IO::Path interface.

method e

method e(IO::Special:D: --> Bool)

The 'exists' file test operator, always returns True.

method d

method d(IO::Special:D: --> Bool)

The 'directory' file test operator, always returns False.

method f

method f(IO::Special:D: --> Bool)

The 'file' file test operator, always returns False.

method s

method s(IO::Special:D: --> Int)

The 'size' file test operator, always returns 0.

method l

method l(IO::Special:D: --> Bool)

The 'symbolic links' file test operator, always returns False.

method r

method r(IO::Special:D: --> Bool)

The 'read access' file test operator, returns True if this is the standard input handle, False otherwise.

method w

method w(IO::Special:D: --> Bool)

The 'write access' file test operator, returns True if this is the standard output or standard error handle, False if it is the standard input.

method x

method x(IO::Special:D: --> Bool)

The 'execute access' file test operator, always returns False.

method modified

method modified(IO::Special:D: --> Instant)

The last modified time always returns an undefined Instant.

method accessed

method accessed(IO::Special:D: --> Instant)

The last accessed time always returns an undefined Instant

method changed

method changed(IO::Special:D: --> Instant)

The last changed time always returns an undefined Instant

method mode

method mode(IO::Special:D: --> Nil)

The mode always returns Nil

Type graph

Type relations for IO::Special
perl6-type-graph IO::Special IO::Special

Stand-alone image: vector