class IO::Special
Path to special I/O device
1 | Methods |
1.1 | method new |
1.2 | method what |
1.3 | method WHICH |
1.4 | method Str |
1.5 | method IO |
1.6 | method e |
1.7 | method d |
1.8 | method f |
1.9 | method s |
1.10 | method l |
1.11 | method r |
1.12 | method w |
1.13 | method x |
1.14 | method modified |
1.15 | method accessed |
1.16 | method changed |
1.17 | method mode |
2 | Type Graph |
does IO
Used as a $.path
attribute in filehandles for special standard input $*IN
and output $*OUT
and $*ERR
. Provides a bridged interface of IO::Handle
, mostly file tests and stringification.
Methods
method new
method new(:!)
Takes a single required attribute what. It is unlikely that you will ever need to construct one of these objects yourself.
method what
say .path.what; # OUTPUT: «<STDIN>»say .path.what; # OUTPUT: «<STDOUT>»say .path.what; # OUTPUT: «<STDERR>»
Returns one of the strings '<STDIN>'
, '<STDOUT>'
, or '<STDERR>'
, specifying the type of the special IO device.
method WHICH
method WHICH(IO::Special: --> Str)
This returns a string that identifies the object. The string is composed by the type of the instance (IO::Special
) and the what
attribute:
.path.what; # OUTPUT: «<STDIN>».path.WHICH; # OUTPUT: «IO::Special<STDIN>»
method Str
method Str(IO::Special:)
This returns '<STDIN>'
, '<STDOUT>'
, or '<STDERR>'
as appropriate.
method IO
method IO(IO::Special: --> IO::Special)
Returns the invocant.
say .path.IO.what; # OUTPUT: «<STDIN>»say .path.what; # OUTPUT: «<STDIN>»
method e
method e(IO::Special: --> True)
The 'exists' file test operator, always returns True
.
method d
method d(IO::Special: --> False)
The 'directory' file test operator, always returns False
.
method f
method f(IO::Special: --> False)
The 'file' file test operator, always returns False
.
method s
method s(IO::Special: --> 0)
The 'size' file test operator, always returns 0
.
method l
method l(IO::Special: --> False)
The 'symbolic links' file test operator, always returns False
.
method r
method r(IO::Special: --> Bool)
The 'read access' file test operator, returns True
if and only if this instance represents the standard input handle(<STDIN>
).
method w
method w(IO::Special: --> Bool)
The 'write access' file test operator, returns True
only if this instance represents either the standard output (<STOUT>
) or the standard error (<STDERR>
) handle.
method x
method x(IO::Special: --> False)
The 'execute access' file test operator, always returns False
.
method modified
method modified(IO::Special: --> Instant)
The last modified time for the filehandle. It always returns an Instant
type object.
method accessed
method accessed(IO::Special: --> Instant)
The last accessed time for the filehandle. It always returns an Instant
type object.
method changed
method changed(IO::Special: --> Instant)
The last changed time for the filehandle. It always returns an Instant
type object.
method mode
method mode(IO::Special: --> Nil)
The mode for the filehandle, it always returns Nil