Lines Matching refs:tempfile

2 # Test for File::Temp - tempfile function
36 use File::Temp qw/ tempfile tempdir/;
43 # Open tempfile in some directory, unlink at end
44 my ($fh, $tempfile) = tempfile(
49 ok( (-f $tempfile), "Tempfile exists" );
52 ok( (-f $tempfile), "Tempfile exists" );
54 push(@files, $tempfile);
81 ($fh, $tempfile) = tempfile(
87 print "# TEMPFILE: Created $tempfile\n";
89 ok( (-f $tempfile), "Local temp file exists with .dat extension");
90 push(@files, File::Spec->rel2abs($tempfile));
92 # Test tempfile
94 ($fh, $tempfile) = tempfile(
99 ok( (-f $tempfile ), "Local tempfile in tempdir exists");
100 push(@files, File::Spec->rel2abs($tempfile));
102 # Test tempfile
104 ($fh, $tempfile) = tempfile(
116 is((stat($tempfile))[2] & 00700, 0600, 'created tempfile with default permissions');
117 push(@files, File::Spec->rel2abs($tempfile));
119 # Test tempfile
121 ($fh, $tempfile) = tempfile(
126 is((stat($tempfile))[2] & 00700, 0400, 'created tempfile with changed permissions');
127 push(@files, File::Spec->rel2abs($tempfile));
129 print "# TEMPFILE: Created $tempfile\n";
133 ($fh, $tempfile) = tempfile( 'helloXXXXXXX',
139 print "# TEMPFILE: Created $tempfile\n";
141 ok( (-f $tempfile), "Local tempfile in tempdir with .dat extension exists" );
142 push(@files, File::Spec->rel2abs($tempfile));
147 ($fh, $tempfile) = tempfile( TEMPLATE => 'goodbyeXXXXXXX',
153 print "# TEMPFILE: Created $tempfile\n";
155 ok( (-f $tempfile), "Local tempfile in tempdir with TEMPLATE" );
156 push(@files, File::Spec->rel2abs($tempfile));
160 ($fh, $tempfile) = tempfile( 'permXXXXXXX', UNLINK => 0 );
161 print "# TEMPFILE: Created $tempfile\n";
162 ok( -f $tempfile, "Long-lived temp file" );
164 push( @still_there, File::Spec->rel2abs($tempfile) ); # check at END
170 # - The unlink0 required on unix for tempfile creation will fail
174 $fh = eval { tempfile( 'ftmpXXXXX', DIR => File::Temp::_wrap_file_spec_tmpdir() ) };