Name

SPVM::IO::File - File Input/Output

Usage

use IO::File;
 
my $io_file = IO::File->new("file", "r");
$io_file->print("Hello");

Description

SPVM::IO::File provides File Input/Output.

Parent Class

IO::Handle.

Fields

stream

has stream : Sys::IO::FileStream;

Class Methods

new

static method new : IO::File ($file_name : string = undef, $open_mode : string = undef);

new_from_fd

static method new_from_fd : IO::Handle ($fd : int, $open_mode : string = undef);

Instance Methods

input_line_number

method input_line_number : long ();

Gets ""input_line_number" field.

set_input_line_number

method set_input_line_number : void ($input_line_number : long);

Sets ""input_line_number" field.

open

method open : void ($file_name : string, $open_mode : string);

fdopen

method fdopen : void ($fd : int, $open_mode : string);

init

protected method init : void ();

DESTROY

method DESTROY : void ();

getline

method getline : string ();

getlines

method getlines : string ();

close

method close : int ();

eof

method eof : int ();

fileno

method fileno : int ();

Gets the file descriptor of "stream" field.

getc

method getc : int ();

print

method print : int ($string : string);

clearerr

method clearerr : void ();

error

method error : int ();

flush

method flush : int ();

ungetc

method ungetc : int ($c : 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);

truncate

method truncate : int ($legnth : long);

Truncates to a size of precisely length bytes.

stat

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

sync

method sync : int ();

See Also

Perl's IO::File

IO::File is a Perl's IO::File porting to SPVM.

Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License