File::Fu::File::Temp - temporary files


NAME

File::Fu::File::Temp - temporary files

Back to Top


SYNOPSIS

  use File::Fu;
  my $handle = File::Fu->temp_file;

new

The directory argument is required, followed by an optional template argument and/or flags. The template may contain some number of 'X' characters. If it does not, ten of them will be appended.

  my $handle = File::Fu::File::Temp->new($dir, 'foo');
  my $file = $handle->name;

By default, the file will be deleted when the handle goes out of scope. Optionally, it may be deleted immediately after creation or just not deleted.

  my $handle = File::Fu::File::Temp->new($dir, 'foo', -secure);
  my $handle = File::Fu::File::Temp->new($dir, -noclean);
  # also $handle->noclean;
-secure

Delete the named file (if the OS supports it) immediately after opening.

Calling name() on this sort of handle throws an error.

-nocleanup

Don't attempt to remove the file when the $handle goes out of scope.

name

  my $file_obj = $handle->name;

nocleanup

Disable autocleanup.

  $handle->nocleanup;

DESTROY

Called automatically when the handle goes out of scope.

  $handle->DESTROY;

Back to Top


AUTHOR

Eric Wilhelm @ <ewilhelm at cpan dot org>

http://scratchcomputing.com/

Back to Top


BUGS

If you found this module on CPAN, please report any bugs or feature requests through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

If you pulled this development version from my /svn/, please contact me directly.

Back to Top


COPYRIGHT

Copyright (C) 2008 Eric L. Wilhelm, All Rights Reserved.

Back to Top


NO WARRANTY

Absolutely, positively NO WARRANTY, neither express or implied, is offered with this software. You use this software at your own risk. In case of loss, no person or entity owes you anything whatsoever. You have been warned.

Back to Top


LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Back to Top

 File::Fu::File::Temp - temporary files