NAME
Haver::OS - Base class for operating-system specific routines.
SYNOPSIS
use Haver::OS;
DESCRIPTION
This inherits from one of the Haver::OS::* modules, depending on which system it is run on. All operating system specific things that are not handled by a standard perl module are handled in the Haver::OS::* modules.
METHODS
This an object oriented module. All methods are called as Haver::OS->methodname
.
type()
Returns the type of operating system, such as Linux, WinNT, Win95, BSD, or Unix.
family()
Returns the family of the operating system, this is either Unix or Windows currently.
user_is_root()
Returns 1 if the operating system user running this process is the root or admin user, zero if not.
Returns undef if the OS doesn't have a concept of a root user.
current_user()
Returns the login name of the user that is controling this process or '' if the OS doesn't have the concept of multiple users.
home()
Returns the home directory of the user that is controlling this process.
On Windows this will be the user's "My Documents" folder.
config_find(%args)
Finds a config file based on options given in %args.
Description of options follows.
name
-
This is the name of the application, such as 'haver-tk'. This option is required.
type
-
The type of config thing we want, either 'file' or 'dir'. Defaults to 'file'.
scope
-
The scope of the config file/dir. Can be one of: global, user, local, or global-data.
On Unix and Linux, global is stored in /etc/, while on BSD it is stored in /etc/local/. In Windows, it is stored under program files.
user and local mean the same thing on all Unix systems (BSD, Linux, etc), and that is $HOME. On Windows XPish, user config files/dirs will be part of the user's roaming profile, while local will not be.
global-data is /var/lib on most Unix systems, while on Windows it is mostly the same as global.
SEE ALSO
File::Spec, File::Path, File::Basename.
https://gna.org/projects/haver/
AUTHOR
Dylan William Hardison, <dylanwh@tampabay.rr.com>
COPYRIGHT AND LICENSE
Copyright (C) 2004 by Dylan William Hardison
This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA