FreeBSD Manual Pages
Connector::Builtin::FiUserPContributed Perl DConnector::Builtin::File::Path(3) Name Connector::Builtin::File::Path Description Highly configurable file writer/reader. Parameters LOCATION The base directory where the files are located. This parameter is mandatory. file Pattern for Template Toolkit to build the filename. The path components are available in the key ARGS. In set mode the unfiltered data is available in key DATA. content Pattern for Template Toolkit to build the content. The data is passed "as is". If data is a scalar, it is wrapped into a hash using DATA as key. ifexists o append: opens the file for appending write. o fail: call "die" o silent: fail silently. o replace: replace the file with the new content. mode Filesystem permissions to apply to the file when a file is written using the set method. Must be given in octal notation, e.g. 0644. Default is to not set the permissions and rely on the systems umask. user / group Name of a user / group that the file should belong to. Supported Methods set Write data to a file. $conn->set('filename', { NAME => 'Oliver', 'ROLE' => 'Administrator' }); See the file parameter how to control the filename. By default, files are silently overwritten if they exist. See the ifexists parameter for an alternative behaviour. get Fetch data from a file. See the file parameter how to control the filename. my $data = $conn->get('filename'); Example my $conn = Connector::Builtin::File::Path->new({ LOCATION: /var/data/ file: [% ARGS.0 %].txt content: Hello [% NAME %] }); $conn->set('test', { NAME => 'Oliver' }); Results in a file /var/data/test.txt with the content Hello Oliver. POD ERRORS Hey! The above document had some coding errors, which are explained below: Around line 268: You forgot a '=back' before '=head1' perl v5.32.0 2020-06-26 Connector::Builtin::File::Path(3)
Name | Description | Parameters | Supported Methods | Example | POD ERRORS
Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Connector::Builtin::File::Path&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>