NAME

SPVM::IO::Handle - I/O Handling

Description

SPVM::IO::Handle is the SPVM's IO::Handle class for I/O handling.

Usage

use IO::Handle;
my $handle = IO::Handle->new;
$handle->set_autoflush(1);

Instance Methods

Fields

fd

has fd : protected int;

A file descriptor.

autoflush

has autoflush : rw byte;

input_line_number

has input_line_number : int;

The current line number of an input file.

opened

has opened : ro protected int;

Blocking

has Blocking : rw protected int;

Class methods

new

static method new : IO::Handle ($options : object[]);

Instance Methods

init

method init : void ($options : object[] = undef);

input_line_number

method input_line_number : long ();

Gets ""input_line_number" field.

This method is planed to be implemented in a child class.

This method always throws an exception.

Excepsions:

Not implemented.

set_input_line_number

method set_input_line_number : void ($input_line_number : long);

Sets ""input_line_number" field.

This method is planed to be implemented in a child class.

This method always throws an exception.

Excepsions:

Not implemented.

close

method close : int ();

eof

method eof : int ();

opened

method opened : int ();

If the return value of "fileno" is greater than -1, returns 1. Otherwise returns 0.

fileno

method fileno : int ();

Gets "fh" field.

getc

method getc : int ();

print

method print : int ($string : string);

say

method say : int ($string : string);

printf

method printf : int ($format : string, $args : object[]...);

clearerr

method clearerr : void ();

error

method error : int ();

flush

method flush : int ();

ungetc

method ungetc : int ($c : int);

printflush

method printflush : int ($string : string);

truncate

method truncate : int ($legnth : long);

Truncates to a size of precisely length bytes.

This method is planed to be implemented in a child class.

This method always throws an exception.

Excepsions:

Not implemented.

ioctl

static method ioctl : int ($fd : int, $request : int, $request_arg_ref : object of byte[]|short[]|int[]|long[]|float[]|double[]|object = undef);

sync

method sync : int ();

stat

method stat : Sys::IO::Stat ();

getline

method getline : string ();

getlines

method getlines : string ();

fcntl

method fcntl : int ($command : int, $command_arg : object = undef of Int|Sys::IO::Flock|object);

set_blocking

method set_blocking : void ($blocking : int);

write

method write : int ($string : string, $length : int = -1, $offset : int = 0);

read

method read : int ($string : mutable string, $length : int = -1, $offset : int = 0);

syswrite

method syswrite : int ($string : string, $length : int = -1, $offset : int = 0) {

sysread

method sysread : int ($string : mutable string, $length : int = -1, $offset : int = 0) {

Well Known Child Classes

IO::File

IO::File

IO::Socket

IO::Socket

IO::Socket::INET

IO::Socket::INET

See Also

IO::Handle

SPVM::IO::Handle is the Perl's IO::Handle porting to SPVM.

Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License