Fixed state: C<path> exists and mode is already correct.
Fixable state: C<path> exists but mode is not correct.
Unfixable state: C<path> doesn't exist.
This function is not exported.
This function is idempotent (repeated invocations with same arguments has the same effect as single invocation). This function supports transactions.
Arguments ('*' denotes required arguments):
=over 4
=item * B<follow_symlink> => I<bool> (default: 0)
Whether to follow symlink.
=item * B<mode>* => I<str>
Permission mode, either numeric or symbolic (e.g. a+w).
=item * B<orig_mode> => I<int>
If set, confirm if current mode is not the same as this.
=item * B<path>* => I<str>
Path to fileE<sol>directory.
=back
Special arguments:
=over 4
=item * B<-tx_action> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_action_id> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_recovery> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_rollback> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_v> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=back
Returns an enveloped result (an array).
First element ($status_code) is an integer containing HTTP-like status code
(200 means OK, 4xx caller error, 5xx function error). Second element
($reason) is a string containing error message, or something like "OK" if status is
200. Third element ($payload) is the actual result, but usually not present when enveloped result is an error response ($status_code is not 2xx). Fourth
element (%result_meta) is called result metadata and is optional, a hash
that contains extra information, much like how HTTP response headers provide additional metadata.
Fixed state: C<path> exists and ownership is already correct.
Fixable state: C<path> exists but ownership is not correct.
Unfixable state: C<path> doesn't exist.
This function is not exported.
This function is idempotent (repeated invocations with same arguments has the same effect as single invocation). This function supports transactions.
Arguments ('*' denotes required arguments):
=over 4
=item * B<follow_symlink> => I<bool> (default: 0)
Whether to follow symlink.
=item * B<group> => I<str>
Numeric GID or group.
=item * B<orig_group> => I<str>
If set, confirm if current group is not the same as this.
=item * B<orig_owner> => I<str>
If set, confirm if current owner is not the same as this.
=item * B<owner> => I<str>
Numeric UID or username.
=item * B<path>* => I<str>
Path to fileE<sol>directory.
=back
Special arguments:
=over 4
=item * B<-tx_action> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_action_id> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_recovery> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_rollback> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_v> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=back
Returns an enveloped result (an array).
First element ($status_code) is an integer containing HTTP-like status code
(200 means OK, 4xx caller error, 5xx function error). Second element
($reason) is a string containing error message, or something like "OK" if status is
200. Third element ($payload) is the actual result, but usually not present when enveloped result is an error response ($status_code is not 2xx). Fourth
element (%result_meta) is called result metadata and is optional, a hash
that contains extra information, much like how HTTP response headers provide additional metadata.
Unfixable state: C<path> exists and is not a directory.
This function is not exported.
This function is idempotent (repeated invocations with same arguments has the same effect as single invocation). This function supports transactions.
Arguments ('*' denotes required arguments):
=over 4
=item * B<allow_symlink> => I<str>
Whether to regard symlink to a directory as directory.
=item * B<mode> => I<str>
Set mode for the newly created directory.
=item * B<path>* => I<str>
Path to directory.
=back
Special arguments:
=over 4
=item * B<-tx_action> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_action_id> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_recovery> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_rollback> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_v> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=back
Returns an enveloped result (an array).
First element ($status_code) is an integer containing HTTP-like status code
(200 means OK, 4xx caller error, 5xx function error). Second element
($reason) is a string containing error message, or something like "OK" if status is
200. Third element ($payload) is the actual result, but usually not present when enveloped result is an error response ($status_code is not 2xx). Fourth
element (%result_meta) is called result metadata and is optional, a hash
that contains extra information, much like how HTTP response headers provide additional metadata.
Fixed state: C<path> exists, is a file, and content is correct.
Fixable state: C<path> doesn't exist. Or C<path> exists, is a file, and content is
incorrect. Or C<orig_path> specified and exists.
Unfixable state: C<path> exists and is not a file.
This function is not exported.
This function is idempotent (repeated invocations with same arguments has the same effect as single invocation). This function supports transactions.
Arguments ('*' denotes required arguments):
=over 4
=item * B<allow_symlink> => I<str>
Whether to regard symlink to a file as file.
=item * B<check_content_func> => I<str>
Name of function to check content.
If unset, file will not be checked for its content. If set, function will be
called whenever file content needs to be checked. Function will be passed the
reference to file content and should return a boolean value indicating whether
content is acceptable. If it returns a false value, content is deemed
unacceptable and needs to be fixed.
Alternatively you can use the simpler C<content> or C<content_md5> argument.
=item * B<content> => I<str>
Desired file content.
Alternatively you can also use C<content_md5>, or C<gen_content_func> and
C<check_content_func>.
=item * B<content_md5> => I<str>
Check content against MD5 hash.
MD5 hash should be expressed in hex (e.g. bed6626e019e5870ef01736b3553e570).
Used when checking content of existing file.
Alternatively you can also use C<content>, or C<check_content_func>.
=item * B<gen_content_func> => I<str>
Name of function to generate content.
If set, whenever a new file content is needed (e.g. when file is created or file
content reset), this function will be called to provide it. If unset, empty
string will be used instead.
Function will be passed the reference to the current content (or undef) and
should return the new content.
Alternatively you can use the simpler C<content> argument.
=item * B<path>* => I<str>
Path to file.
=item * B<suffix> => I<str>
(No description)
=back
Special arguments:
=over 4
=item * B<-tx_action> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_action_id> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_recovery> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_rollback> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_v> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=back
Returns an enveloped result (an array).
First element ($status_code) is an integer containing HTTP-like status code
(200 means OK, 4xx caller error, 5xx function error). Second element
($reason) is a string containing error message, or something like "OK" if status is
200. Third element ($payload) is the actual result, but usually not present when enveloped result is an error response ($status_code is not 2xx). Fourth
element (%result_meta) is called result metadata and is optional, a hash
that contains extra information, much like how HTTP response headers provide additional metadata.
Fixable state: C<path> exists and is a directory (or, a symlink to a directory,
if C<allow_symlink> option is enabled).
Unfixable state: C<path> exists but is not a directory.
This function is not exported.
This function is idempotent (repeated invocations with same arguments has the same effect as single invocation). This function supports transactions.
Arguments ('*' denotes required arguments):
=over 4
=item * B<allow_symlink> => I<bool> (default: 0)
Whether to regard symlink to a directory as directory.
=item * B<delete_nonempty_dir> => I<bool>
Whether to delete non-empty directory.
If set to true, will delete non-empty directory.
If set to false, will never delete non-empty directory.
If unset (default), will ask for confirmation first by returning status 331.
Caller can confirm by passing special argument C<-confirm>.
=item * B<path>* => I<str>
(No description)
=back
Special arguments:
=over 4
=item * B<-tx_action> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_action_id> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_recovery> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_rollback> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_v> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=back
Returns an enveloped result (an array).
First element ($status_code) is an integer containing HTTP-like status code
(200 means OK, 4xx caller error, 5xx function error). Second element
($reason) is a string containing error message, or something like "OK" if status is
200. Third element ($payload) is the actual result, but usually not present when enveloped result is an error response ($status_code is not 2xx). Fourth
element (%result_meta) is called result metadata and is optional, a hash
that contains extra information, much like how HTTP response headers provide additional metadata.
Fixable state: C<path> exists and is a file (or, a symlink to a file, if
C<allow_symlink> option is enabled).
Unfixable state: C<path> exists but is not a file.
This function is not exported.
This function is idempotent (repeated invocations with same arguments has the same effect as single invocation). This function supports transactions.
Arguments ('*' denotes required arguments):
=over 4
=item * B<allow_symlink> => I<bool> (default: 0)
Whether to regard symlink to a file as file.
=item * B<orig_content> => I<str>
If set, confirm if current content is not the same as this.
Alternatively, you can use C<orig_content_hash>.
=item * B<orig_content_md5> => I<str>
If set, confirm if current content MD5 hash is not the same as this.
MD5 hash should be expressed in hex (e.g. bed6626e019e5870ef01736b3553e570).
Alternatively, you can use C<orig_content> (for shorter content).
=item * B<path>* => I<str>
(No description)
=item * B<suffix> => I<str>
Use this suffix when trashing.
=back
Special arguments:
=over 4
=item * B<-tx_action> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_action_id> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_recovery> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_rollback> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_v> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=back
Returns an enveloped result (an array).
First element ($status_code) is an integer containing HTTP-like status code
(200 means OK, 4xx caller error, 5xx function error). Second element
($reason) is a string containing error message, or something like "OK" if status is
200. Third element ($payload) is the actual result, but usually not present when enveloped result is an error response ($status_code is not 2xx). Fourth
element (%result_meta) is called result metadata and is optional, a hash
that contains extra information, much like how HTTP response headers provide additional metadata.
Replace existing symlink if it needs to be replaced.
=item * B<should_exist> => I<bool>
Whether dir should exist.
If undef, dir need not exist. If set to 0, dir must not exist and will be
deleted if it does. If set to 1, dir must exist and will be created if it
doesn't.
=back
Special arguments:
=over 4
=item * B<-tx_action> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_action_id> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_recovery> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_rollback> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_v> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=back
Returns an enveloped result (an array).
First element ($status_code) is an integer containing HTTP-like status code
(200 means OK, 4xx caller error, 5xx function error). Second element
($reason) is a string containing error message, or something like "OK" if status is
200. Third element ($payload) is the actual result, but usually not present when enveloped result is an error response ($status_code is not 2xx). Fourth
element (%result_meta) is called result metadata and is optional, a hash
that contains extra information, much like how HTTP response headers provide additional metadata.
Replace existing symlink if it needs to be replaced.
=item * B<should_exist> => I<bool>
Whether file should exist.
If undef, file need not exist. If set to 0, file must not exist and will be
deleted if it does. If set to 1, file must exist and will be created if it
doesn't.
=back
Special arguments:
=over 4
=item * B<-tx_action> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_action_id> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_recovery> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_rollback> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=item * B<-tx_v> => I<str>
For more information on transaction, see LE<lt>Rinci::TransactionE<gt>.
=back
Returns an enveloped result (an array).
First element ($status_code) is an integer containing HTTP-like status code
(200 means OK, 4xx caller error, 5xx function error). Second element
($reason) is a string containing error message, or something like "OK" if status is
200. Third element ($payload) is the actual result, but usually not present when enveloped result is an error response ($status_code is not 2xx). Fourth
element (%result_meta) is called result metadata and is optional, a hash
that contains extra information, much like how HTTP response headers provide additional metadata.
Return value: (any)
=head1 FAQ
=head2 Why not allowing coderef in 'check_content_func' and 'gen_content_func' argument?
Because transactional function needs to store its argument in database
(currently in JSON), coderefs are not representable in JSON.