check_safe( FILENAME , MODE );
Checks FILENAME is safe - dies if not. MODE is r (read) or w (write).
$temporary_directory = get_temp_dir();
Returns the path to temporary directory. Note that any return value will have been cleared of a trailing slash.
$log_directory = get_log_dir();
Returns the path to log directory. Note that any return value will have been cleared of a trailing slash.
To implement your own custom policy
cp File/Policy/Default.pm File/Policy/YourPolicy.pm
and modify YourPolicy accordingly. Then, create File/Policy/Config.pm contaning:
use constant IMPLEMENTATION => YourPolicy;
Now having used File::Policy, calling check_safe in your scripts will enforce your policy (as well as give you access to log and temp paths in locations you recommend).
$Revision: 1.5 $ on $Date: 2005/05/18 15:58:21 $ by $Author: johna $
John Alden <cpan _at_ bbc _dot_ co _dot_ uk>
(c) BBC 2005. This program is free software; you can redistribute it and/or modify it under the GNU GPL.
See the file COPYING in this distribution, or http://www.gnu.org/licenses/gpl.txt
|perl v5.20.3||FILE::POLICY (3)||2005-06-15|