GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
OpenXPKI::FileUtils(3) User Contributed Perl Documentation OpenXPKI::FileUtils(3)

Helper class for file operations and temp file management.

The constructor expects arguments as a hash.
TMP
The parent directory to use for all temporary items created. If not set /tmp is used.

Reads the content of the given filename and returns it as string, pass utf8 as second parameter to read the file in utf8 mode. Throws an exception if the file can not be read.

Expects a hash with the keys CONTENT and FILENAME. The method will NOT overwrite an existing file but throw an exception if the target already exists, unless FORCE is passed a true value or the filename is a tempfile created by get_safe_tmpfile before.

Create an emtpty tempfile and returns its name. You can pass a hash with the key TMP set to the parent directory to use, if not set the directory given to the constructor is used.

The file will NOT be removed unless you call the cleanup method of this class instance.

Create an emtpty directory and returns its name. You can pass a hash with the key TMP set to the parent directory to use, if not set the directory given to the constructor is used.

The directory will NEVER be removed autmatically.

Create a temporary file and return the object handle of it. The return value can be used in string context to get the name of the directory created. The handle will be held open by the class so it will stay in the filesystem until the class is destroyed.

Create a temporary directory and return the object handle of it. The return value can be used in string context to get the name of the directory created. The handle will be held open by the class so it will stay in the filesystem until the class is destroyed.

Expects the content to write as argument. Creates a temporary file handle using get_tmp_handle and writes the data to it. The filehandle is closed and the name of the file is returned.

Unlink files created with get_safe_tempfile and remove all handles held by the instance so File::Temp should cleanup them.

Warning: This method is not fork-safe and will delete any files created with get_safe_tempfile across forks!

2022-05-14 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.