SPVM-Sys

 view release on metacpan or  search on metacpan

lib/SPVM/Sys.pm  view on Meta::CPAN

If $atime < 0 and $mtime < 0, changes the access time and the modification time to the current time..

Exceptions:

Exceptions thrown by L<Sys::Time#utime|SPVM::Sys::Time/"utime"> method could be thrown.

=head2 stat

C<static method stat : L<Sys::IO::Stat|SPVM::Sys::IO::Stat> ($file : string);>

Returns information about a file $file.

Exceptions:

Exceptions thrown by L<Sys::IO::Stat#stat|SPVM::Sys::IO::Stat/"stat"> method could be thrown.

=head2 lstat

C<static method lstat : L<Sys::IO::Stat|SPVM::Sys::IO::Stat> ($file : string);>

Identical to L</"stat">, except that if path $file is a symbolic link(or directory junction only in Windows), then the link itself is stat-ed, not the file that it refers to.

In Windows, this method calls the L<lstat|SPVM::Sys::IO::Windows/"lstat"> method, otherwise calls the L<lstat|SPVM::Sys::IO::Stat/"lstat"> method.

Exceptions:

Exceptions thrown by L<Sys::IO::Stat#lstat|SPVM::Sys::IO::Stat/"lstat"> method or L<Sys::IO::Windows#lstat|SPVM::Sys::IO::Windows/"lstat"> method could be thrown.

=head2 fstat

C<static method fstat : L<Sys::IO::Stat|SPVM::Sys::IO::Stat> ($fd : int);>

Identical to L</"stat">, except that the file to be stat-ed is specified by the file descriptor $fd.

Exceptions:

Exceptions thrown by L<Sys::IO::Stat#fstat|SPVM::Sys::IO::Stat/"fstat"> method could be thrown.

=head2 env

C<static method env : string ($name : string);>

Gets an environment variable with the name $name.

=head2 set_env

C<static method set_env : void ($name : string, $value : string);>

Sets an environment variable with the name $name and the value $value.

If $value is undef or "", the environment variable is removed.

Exceptions:

This method calls the following methods, so exceptions thrown by these methods could be thrown.

=over 2

=item * L<_putenv_s|SPVM::Sys::Env/"_putenv_s"> in Sys::Env

=item * L<setenv|SPVM::Sys::Env/"setenv"> in Sys::Env

=item * L<unsetenv|SPVM::Sys::Env/"unsetenv"> in Sys::Env

=back

=head2 osname

C<static method osname : string ()>

Gets the OS name. This method corresponds to Perl's L<$^O|https://perldoc.perl.org/perlvar#$%5EO>.

=over 2

=item * C<linux>

=item * C<darwin>

=item * C<MSWin32>

=item * C<freebsd>

=item * C<openbsd>

=item * C<solaris>

=back

Exceptions:

If the OS name could not be determined, an exception is thrown.

=head2 socket

C<static method socket : void ($socket_fd_ref : int*, $domain : int, $type : int, $protocol : int);>

Opens a socket given the domain $domain, the type $type, and the protocal $protocol.

The created socket file descriptor is set to the value referenced by $socket_fd_ref.

This method calls L<Sys::Socket#socket|SPVM::Sys::Socket/"socket"> method.

If the system supports C<FD_CLOEXEC>, this flag is set to the value referenced by $socket_fd_ref using L</"fcntl">.

Exceptions:

Exceptions thrown by L<Sys::Socket#socket|SPVM::Sys::Socket/"socket"> method could be thrown.

=head2 connect

C<static method connect : void ($socket_fd : int, $sockaddr : L<Sys::Socket::Sockaddr|SPVM::Sys::Socket::Sockaddr>);>

Attempts to connect to a remote socket, just like the C<connect> system call.

This method calls L<Sys::Socket#connect|SPVM::Sys::Socket/"connect"> method.

Exceptions:

Exceptions thrown by L<Sys::Socket#connect|SPVM::Sys::Socket/"connect"> method could be thrown.

=head2 bind

C<static method bind : void ($socket_fd : int, $sockaddr : L<Sys::Socket::Sockaddr|SPVM::Sys::Socket::Sockaddr>);>



( run in 3.584 seconds using v1.01-cache-2.11-cpan-6aa56a78535 )