File::Policy::Default(3pm) User Contributed Perl Documentation File::Policy::Default(3pm)NAME
File::Policy::Default - Default policy for file I/O functions
SYNOPSIS
use File::Policy;
use File::Policy qw/check_safe/; # to import a specific subroutine
use File::Policy qw/:all/; # to import all subroutines
#Checking I/O policy
check_safe($filename, 'r');
check_safe($filename, 'w');
#Portable directory locations
$logdir = get_log_dir();
$tmpdir = get_temp_dir();
DESCRIPTION
This defines the default (unrestricted) policy for file I/O with modules such as File::Slurp::WithinPolicy. You may replace this default
policy with one for your organisation.
FUNCTIONS
check_safe
check_safe( FILENAME , MODE );
Checks a filename is safe - dies if not. MODE is r (read) or w (write). Default is no restrictions on file I/O.
get_temp_dir
$temporary_directory = get_temp_dir();
Returns the path to temporary directory from the TEMP environment variable or File::Spec::Functions::tmpdir(). Note that any return
value will have been cleared of a trailing slash.
get_log_dir
$log_directory = get_log_dir();
Returns the path to log directory from the LOGDIR environment variable or the current directory. Note that any return value will have
been cleared of a trailing slash.
VERSION
$Revision: 1.6 $ on $Date: 2005/05/18 15:57:28 $ by $Author: johna $
AUTHOR
John Alden <cpan _at_ bbc _dot_ co _dot_ uk>
COPYRIGHT
(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.8.8 2005-06-15 File::Policy::Default(3pm)
Check Out this Related Man Page
File::Slurp::WithinPolicy(3pm) User Contributed Perl Documentation File::Slurp::WithinPolicy(3pm)NAME
File::Slurp::WithinPolicy - Applies filesystem policies to File::Slurp
SYNOPSIS
use File::Slurp::WithinPolicy qw(:all);
my $text = read_file( 'filename' );
my @lines = read_file( 'filename' );
write_file( 'filename', $text );
append_file( 'filename', $more_text );
overwrite_file( 'filename', $text );
my @files = read_dir( '/path/to/dir' );
DESCRIPTION
This provides the File::Slurp interface within a policy defined by File::Policy. By default, File::Policy is a no-op and this behaves
identically to File::Slurp. System administrators may want to override the default File::Policy implementation to enforce a local filesys-
tem policy (see File::Policy).
FUNCTIONS
read_dir
See "read_dir" in File::Slurp
read_file
See "read_file" in File::Slurp
write_file
See "write_file" in File::Slurp
append_file
See "append_file" in File::Slurp
overwrite_file
See "overwrite_file" in File::Slurp
EXPORTS
By default, nothing is exported. The ":all" tag can be used to export everything. Individual methods can also be exported.
SEE ALSO
File::Slurp, File::Policy
VERSION
$Revision: 1.4 $ on $Date: 2005/06/15 10:40:21 $ by $Author: simonf $
AUTHOR
John Alden <cpan _at_ bbc _dot_ co _dot_ uk>
COPYRIGHT
(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.8.8 2005-06-15 File::Slurp::WithinPolicy(3pm)
Hi Team,
I am a new bie to unix and want to check a directory for a files with extension *.doc exceeding a specific file size limit,and will give me a buffer ooutput as below
I used below command,
find . -name \*.doc -size +3k -printf "|%p |%k KB"
which resulted as,
./ABC_sw_high.doc ... (1 Reply)
Hi,
I have a file on Sunos with permissions:
-rw-r--r--
When I 'more' it...I get the message:
*** filename: directory ***
And it is acutally a directory. How come there is no 'd' shpwing on the file permission settings?
Thanks (2 Replies)
Hi,
I want to saperate file path and file name into two variables.
for ex:- lets say file is /home/prasoon/File.txt
i want FILE_PATH=/home/prasoon
and FILENAME=File.txt
i need your help.
Cheers
Prasoon (2 Replies)