File::MkTempO

File::MkTempO is a Perl module to make temporary filename from template.
Download

File::MkTempO Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Travis Gummels
  • Publisher web site:
  • http://search.cpan.org/~tgummels/File-MkTemp-1.0.6/File/MkTempO.pm

File::MkTempO Tags


File::MkTempO Description

File::MkTempO is a Perl module to make temporary filename from template. File::MkTempO is a Perl module to make temporary filename from template.SYNOPSIS use File::MkTempO; $object = new File::MkTempO('tempXXXXXX','dir'); $string = $object->mktemp; open(F,$string); close(); $fh = $object->mkstemp; print $fh "stuff"; $fh->close; print "template stored in the object: $object->templaten"; print "directory stored in the object: $object->dirn"; print "file handle in scalar form: $object->fhtmpln"; print "fh and the directory in scalar form: $object->fhdirtmpln";The MkTempO module provides the following functions: new() - for creation of the object. mktemp() - for creation of a unique string based on the template mkstemp() - for creation of a unique file handle opened in the directory specified during creation of the object. template() - for returning the template stored in the object. dir() - for returning the directory stored in the object. fhtmpl() - for returning the file handle in scalar form. fhdirtmpl()- for returning the file handle and the directory its in.The function mktemp() returns a unique string based upon the template. The template must contain at least six trailing Xs. The Xs are replaced by a unique string and the template is returned. The unique string is made from picking random elements out of a 52 alpha character array (). A directory can be specified in which to test for duplicates of the string.The function mkstemp() does the same as mktemp() except it returns an open file handle. This prevents any possibility of opening up an identical file. The function requires that the directory be specified when creating the object with the new function. Requirements: · Perl


File::MkTempO Related Software