ONO::Core::HostIO

ONO::Core::HostIO is responsible for low level communication with the host operating system.

Note that file system I/O calls allow access to the entire host systems file system (unlike ONO::IO, which only accesses the file system within the document root).

Using this module in production projects should be avoided whenever possible, try to use ONO::IO or other library / toolbox features instead.

Functions

chgrp();

Change the group of a file or a directory.

ONO::Core::HostIO->chgrp( );

chmod();

Change the mode (permissions, access rights) of a file or a directory.

ONO::Core::HostIO->chmod( );

chmodr();

Recursively change the mode (permissions, access rights) of a file or a directory.

ONO::Core::HostIO->chmodr( );

chown();

Change the owner of a file or a directory.

ONO::Core::HostIO->chown( );

chowngrpr();

Recursively change both the owner and the group of a directory (or a file).

ONO::Core::HostIO->chowngrpr( );

cleanpath();

Check and clean input path (dir and file name), remove all special characters, don't allow paths starting by a dot. Add an optional ,1 to make this less restrictive.

ONO::Core::HostIO->cleanpath( );

cp();

Copy a file to a new location.

ONO::Core::HostIO->cp( );

cpr();

Copy a directory to a new location.

ONO::Core::HostIO->cpr( );

exec();

Not implemented (yet).

ONO::Core::HostIO->exec( );

exists();

Check if dir or file exists

ONO::Core::HostIO->exists( );

groupadd();

Add a UNIX group on the host OS. Note that this feature will need to be run as root.

ONO::Core::HostIO->groupadd( );

groupget();

Check if a UNIX group exists on the host OS, return its basic info if true.

ONO::Core::HostIO->groupget( );
returns: $group

list();

List a file, return its content as an array of lines.

ONO::Core::HostIO->list( );
returns: @data

load();

Load a file, return its content, removing carriage returns (line feeds will be kept).

ONO::Core::HostIO->load( );
returns: $dump

ls();

List files and directories

ONO::Core::HostIO->ls( );
returns: @objs

mailserver_reload();

Reload / restart all mailserver services on the host OS. Note that this feature will need to be run as root.

ONO::Core::HostIO->mailserver_reload( );

mkdir();

Create a new directory.

ONO::Core::HostIO->mkdir( );

mv();

Move a file or a directory to a new location.

ONO::Core::HostIO->mv( );

rm();

Remove / delete a file

ONO::Core::HostIO->rm( );

rmdir();

Recursively remove / delete a directory. This has not been implemented, as it is considered to be too dangerous.

ONO::Core::HostIO->rmdir( );

size();

Return the size of a file in bytes.

ONO::Core::HostIO->size( );
returns: $size

store();

Store a content to a file. Be careful, existing files will be overwritten!

ONO::Core::HostIO->store( );

symlink();

Create a symbolic link

ONO::Core::HostIO->symlink( );

timestamp();

Return the modification timestamp of a file or directory

ONO::Core::HostIO->timestamp( );
returns: $mtime

unlink();

Remove a symbolic link

ONO::Core::HostIO->unlink( );

usage();

Return dir usage in KB

ONO::Core::HostIO->usage( );
returns: $usage

useradd();

Add a UNIX user on the host OS. Note that this feature will need to be run as root.

ONO::Core::HostIO->useradd( );

userdel();

Remove a UNIX user on the host OS. Note that this feature will need to be run as root.

ONO::Core::HostIO->userdel( );

userget();

Check if a UNIX user exists on the host OS, return its basic info if true.

ONO::Core::HostIO->userget( );
returns: $user

userpwd();

Change a UNIX user's password on the host OS. Note that this feature will need to be run as root.

ONO::Core::HostIO->userpwd( );

Sub-Modules

none

Dependencies