The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Name

SPVM::Sys - System Calls such as File IO, User, Process, Socket,

Caution

The Sys module and the system modules will be highly changed without warnings.

SPVM itself is yet experimental release.

Usage

  use Sys;
  
  my $is_windows = Sys->is_D_WIN32;

Description

Sys is the class for system utilities such as file IO, user manipulation, process, socket,

Class Methods

is_D_WIN32

  static method is_D_WIN32 : int ()

If _WIN32 in C language is defined, return 1. Otherwize return 0.

getenv

  static method getenv : string ($name : string);

The getenv() function searches the environment list to find the environment variable name, and returns a pointer to the corresponding value string.

See the detail of the getenv function in the case of Linux.

setenv

  static method setenv : int ($name : string, $value : string, $overwrite : int);

The setenv() function adds the variable name to the environment with the value value, if name does not already exist. If name does exist in the environment, then its value is changed to value if overwrite is nonzero; if overwrite is zero, then the value of name is not changed. This function makes copies of the strings pointed to by name and value (by contrast with putenv(3)).

See the detail of the setenv function in the case of Linux.

unsetenv

  static method unsetenv : int ($name : string);

The unsetenv() function deletes the variable name from the environment. If name does not exist in the environment, then the function succeeds, and the environment is unchanged.

See the detail of the unsetenv function in the case of Linux.

System Modules

Repository

https://github.com/yuki-kimoto/SPVM-Sys

Copyright & License

Copyright Yuki Kimoto 2022-2022, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.