NAME
Config::Find::Where - Find locations in the native OS fashion
SYNOPSIS
use Config::Find::Where;
my $temp_dir=Config::Find::Where->temp_dir( name => 'my_app',
scope => 'process',
create => 1 );
my $path=Config::Find::Where->bin_dir( scope => 'app' );
system $path."/app_helper.exe";
ABSTRACT
Config::Find searchs for locations using OS dependant heuristics.
DESCRIPTION
After releasing Config::Find I found much of its code could be reused to also find other interesting things like temporary directories, the script location, etc.
This module adds a public API to all the hiden functionallity.
OPTIONS
As in Config::Find, all the methods in this package accept a common set of options:
- name =>
name
orname/more/names
-
specifies the primary application name used to generate the location paths or to search for them.
- scope =>
user
,global
,app
orprocess
-
-
- create => 1
-
creates any unexistant directory in the path returned
METHODS
All the methods in this package are class methods (you don't need an object to call them).
- $path=Config::Find::Where->temp_dir(%opts)
-
returns a directory path inside a system temporary location. i.e.:
Config::Find::Where->temp_dir( name =>'hello/world', scope => 'process', create => 1 )
returns something similar to
'/tmp/jacks/hello/974/world/'
on unix like systems and
'C:\Windows\Temp\jacks\hello\974\world'
on some Windows ones ('jacks' is supposed to be the current user name and '974' the process number).
The default scope for this method is
user
. - $path=Config::Find::Where->bin_dir(%opts)
-
returns a place to find/place binary files.
i.e.
Config::Find->bin_dir()
returns the path to the directory where the running script is located.
The default scope for this method is
app
. - $name=Config::Find::Where->script_name()
-
returns the name of the running script without any path information
- $path=Config::Find::Where->script_full_path()
-
returns the name of the script as the absolute full path to it.
EXPORT
None, this module has an OO interface.
BUGS
Some Win32 OSs are not completely implemented and default to inferior modes, but hey, this is a work in progress!!!
Contributions, bug reports, feedback and any kind of comments are welcome.
SEE ALSO
AUTHOR
Salvador Fandiño García, <sfandino@yahoo.com>
COPYRIGHT AND LICENSE
Copyright 2003 by Salvador Fandiño García
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 230:
Non-ASCII character seen before =encoding in 'Fandiño'. Assuming CP1252