Name

SPVM::IO - File IO, Sockets, Directory Manipulation, Select/Polling.

Description

Classes in IO distribution in SPVM has methods to manipulate file IO, directory manipulation, sockets, select/polling.

Usage

use IO;

# Write a line
my $fh = IO->open(">", "foo.txt");
$fh->say("Hello");>

# Read lines
my $dh = IO->opendir("dir");
while (my $dir = $dh->read) {
  
}

Modules

Class Methods

open

static method open : IO::File ($open_mode : string, $file_name : string);

Opens a file stream.

This method just calls IO::File#new method given $file_name $open_mode, returns its return value.

Exceptions:

Exceptions thrown by IO::File#new method could be thrown.

opendir

static method opendir : IO::Dir ($dir_path : string);

Opens a directory stream.

This method just calls IO::Dir#new method given $dir_path and returns its return value.

Exceptions:

Exceptions thrown by IO::Dir#new method could be thrown.

Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License