Lines Matching +full:fine +full:- +full:tuning

1 package File::Temp; # git description: v0.2310-3-gc7148fe
68 #pod $fh = File::Temp->new();
69 #pod $fname = $fh->filename;
71 #pod $fh = File::Temp->new(TEMPLATE => $template);
72 #pod $fname = $fh->filename;
74 #pod $tmp = File::Temp->new( UNLINK => 0, SUFFIX => '.dat' );
77 #pod $tmp->seek( 0, SEEK_END );
79 #pod $dir = File::Temp->newdir(); # CLEANUP => 1 by default
111 #pod way. There is both a function interface and an object-oriented
156 # pre-emptively load Carp::Heavy. If we don't when we run out of file
178 # Export list - to allow fine tuning of export table
259 # to automatically remove the file when it is closed. This is fine
261 # the filename is requested -- in the case where the filename is to
285 # INTERNAL ROUTINES - not to be used outside of package
295 # TEMPLATE - string containing the XXXXX's that is converted
322 # filehandle - open file handle (if called with doopen=1, else undef)
323 # temp name - name of the temp file or directory
336 # the internal error string - expect it to be overridden
381 my $start = length($template) - 1 - $options{"suffixlen"};
386 # Do it using substr - no reason to use a pattern match since
389 if (substr($template, $start - MINX + 1, MINX) ne 'X' x MINX) {
404 # Split the path into constituent parts - eventually we need to check
413 ($volume, $directories, $file) = File::Spec->splitpath( $path, 1);
417 my @dirs = File::Spec->splitdir($directories);
422 $parent = File::Spec->curdir;
426 $parent = File::Spec->catdir($volume, @dirs[0..$#dirs-1]);
431 $parent = File::Spec->catdir(@dirs[0..$#dirs-1]);
434 $parent = File::Spec->catpath($volume, $parent, '');
442 ($volume, $directories, $file) = File::Spec->splitpath( $path );
445 $parent = File::Spec->catpath($volume,$directories,'');
448 $parent = File::Spec->curdir
455 # not a file -- no point returning a name that includes a directory
458 unless (-e $parent) {
462 unless (-d $parent) {
471 if (File::Temp->safe_level == MEDIUM) {
477 } elsif (File::Temp->safe_level == HIGH) {
496 # If we are running before perl5.6.0 we can not auto-vivify
501 # Try to make sure this will be marked close-on-exec
524 # Opened successfully - return file handle and name
529 # Error opening file - abort with error
565 return (undef, $path) unless -e $path;
577 # Store current attempt - in principle this implies that the
629 # Alternatively, could simply set $ignore to length($path)-1
634 substr($path, 0, - $ignore) =~ s/X(?=X*$end)/$CHARS[ int( rand( @CHARS ) ) ]/ge;
686 if ($info[4] > File::Temp->top_system_uid() && $info[4] != $>) {
689 File::Temp->top_system_uid());
704 unless (-d $path) {
710 unless (-k $path) {
732 # Need POSIX - but only want to bother if really necessary due to overhead
762 unless (File::Spec->file_name_is_absolute($path)) {
763 $path = File::Spec->rel2abs($path);
766 # Split directory into components - assume no file
767 my ($volume, $directories, undef) = File::Spec->splitpath( $path, 1);
774 my @dirs = File::Spec->splitdir($directories);
779 my $dir = File::Spec->catpath($volume,
780 File::Spec->catdir(@dirs[0.. $#dirs - $pos]),
841 # - Called by unlink0 if an opened file can not be unlinked
842 # - Called by tempfile() if files are to be removed on shutdown
843 # - Called by tempdir() if directories are to be removed on shutdown
848 # - filehandle (so that it can be explicitly closed if open
849 # - filename (the thing we want to remove)
850 # - isdir (flag to indicate that we are being given a directory)
895 close($file->[0]); # file handle is [0]
897 if (-f $file->[1]) { # file name is [1]
898 _force_writable( $file->[1] ); # for windows
899 unlink $file->[1] or warn "Error removing ".$file->[1];
907 if (-d $dir) {
914 $cwd = Cwd::abs_path(File::Spec->curdir) if not defined $cwd;
930 my $updir = File::Spec->updir;
969 if (-d $fname) {
984 if (-f $fname) {
1020 #pod =head1 OBJECT-ORIENTED INTERFACE
1048 #pod my $tmp = File::Temp->new();
1061 #pod $tmp = File::Temp->new( TEMPLATE => 'tempXXXXX',
1082 my $unlink = (exists $args->{UNLINK} ? $args->{UNLINK} : 1 );
1083 delete $args->{UNLINK};
1086 delete $args->{OPEN};
1091 print "Tmp: $fh - $path\n" if $DEBUG;
1105 # final method-based configuration
1106 $fh->unlink_on_destroy( $unlink );
1115 #pod $dir = File::Temp->newdir();
1122 #pod $dir = File::Temp->newdir( $template, %options );
1139 my $cleanup = (exists $args->{CLEANUP} ? $args->{CLEANUP} : 1 );
1140 delete $args->{CLEANUP};
1161 #pod $filename = $tmp->filename;
1177 return $self->filename;
1192 #pod $dirname = $tmpdir->dirname;
1201 #pod $fh->unlink_on_destroy( 1 );
1232 #pod directory is your current directory, it cannot be removed - a warning
1247 # and post-destruction there is no reason to know about the file.
1248 my $file = $self->filename;
1256 print "# ---------> Unlinking $self\n" if $DEBUG;
1314 #pod Equivalent to specifying a DIR of "File::Spec->tmpdir", writing the file
1328 #pod Use the object-oriented interface if fine-grained control of when
1409 my $template = @$maybe_template ? $maybe_template->[0] : undef;
1440 $template = File::Spec->catfile($options{"DIR"}, $template);
1444 $template = File::Spec->catfile(_wrap_file_spec_tmpdir(), $template );
1452 $template = File::Spec->catfile($options{"DIR"}, TEMPXXX);
1456 $template = File::Spec->catfile(_wrap_file_spec_tmpdir(), TEMPXXX);
1468 # we have to indicate temporary-ness when we open the file. In general
1470 # filehandle - if the user wants the filename they probably do not
1528 return File::Spec->tmpdir unless $^O eq "MSWin32" && ${^TAINT};
1531 return $alt_tmpdir ? $alt_tmpdir : File::Spec->tmpdir;
1537 # First, see if File::Spec->tmpdir is writable
1538 my $tmpdir = File::Spec->tmpdir;
1539 my $testpath = File::Spec->catdir( $tmpdir, $xxpath );
1548 my $local_app = File::Spec->catdir(
1551 $testpath = File::Spec->catdir( $local_app, $xxpath );
1552 if ( -e $local_app or mkdir( $local_app, 0700 ) ) {
1613 #pod $tempdir = tempdir ( $template, DIR => File::Spec->tmpdir);
1656 my $template = @$maybe_template ? $maybe_template->[0] : undef;
1673 my ($volume, $directories, undef) = File::Spec->splitpath( $template, 1);
1676 $template = (File::Spec->splitdir($directories))[-1];
1681 $template = File::Spec->catdir($options{"DIR"}, $template);
1686 $template = File::Spec->catdir(_wrap_file_spec_tmpdir(), $template);
1696 $template = File::Spec->catdir($options{"DIR"}, TEMPXXX);
1700 $template = File::Spec->catdir(_wrap_file_spec_tmpdir(), TEMPXXX);
1713 if ( ($^O eq 'MacOS') && (substr($template, -1) eq ':') ) {
1728 if ( $options{'CLEANUP'} && -d $tempdir) {
1868 if ( ($^O eq 'MacOS') && (substr($template, -1) eq ':') ) {
1923 #pod This section describes the re-implementation of the tmpnam()
1969 # XXX I don't know under what circumstances this occurs, -- xdg 2016-04-02
1974 my $template = File::Spec->catfile($tmpdir, TEMPXXX);
2062 my $template = File::Spec->catfile($dir, $prefix);
2146 croak "unlink0: $path has become a directory!" if -d $path;
2155 # - Cygwin provides deferred unlinking, however,
2162 # fall-through if we can't unlink now
2205 # Stat the filehandle - which may be closed if someone has manually
2228 unless (-f $path) {
2255 # is fine since we are only comparing integers.
2270 #pod mean that the post-unlink comparison of the filehandle state provided
2364 #pod Will not work on platforms that do not support the C<-k> test
2384 #pod File::Temp->safe_level( File::Temp::HIGH );
2405 #pod $newlevel = File::Temp->safe_level( File::Temp::HIGH );
2421 … carp "safe_level: Specified level ($level) not STANDARD, MEDIUM or HIGH - ignoring\n" if $^W;
2450 #pod File::Temp->top_system_uid(10);
2451 #pod my $topid = File::Temp->top_system_uid;
2514 #pod arbitrary programs. Perl code that uses the 2-argument version of
2517 #pod close-on-exec bit on that file descriptor before passing it to another
2522 #pod or die "Can't clear close-on-exec flag on temp fh: $!\n";
2591 #pod See L<File::Tempdir> for an alternative object-oriented wrapper for
2608 # created by File::Temp->newdir
2613 # Read-only - returns the name of the temp directory
2617 return $self->{DIRNAME};
2622 return $self->dirname;
2628 $self->{CLEANUP} = shift;
2630 return $self->{CLEANUP};
2636 if ($self->unlink_on_destroy &&
2637 $$ == $self->{LAUNCHPID} && !$File::Temp::KEEP_ALL) {
2638 if (-d $self->{REALNAME}) {
2643 eval { rmtree($self->{REALNAME}, $File::Temp::DEBUG, 0); };
2658 =encoding UTF-8
2662 File::Temp - return name and handle of a temporary file safely
2690 $fh = File::Temp->new();
2691 $fname = $fh->filename;
2693 $fh = File::Temp->new(TEMPLATE => $template);
2694 $fname = $fh->filename;
2696 $tmp = File::Temp->new( UNLINK => 0, SUFFIX => '.dat' );
2699 $tmp->seek( 0, SEEK_END );
2701 $dir = File::Temp->newdir(); # CLEANUP => 1 by default
2733 way. There is both a function interface and an object-oriented
2801 =head1 OBJECT-ORIENTED INTERFACE
2829 my $tmp = File::Temp->new();
2842 $tmp = File::Temp->new( TEMPLATE => 'tempXXXXX',
2858 $dir = File::Temp->newdir();
2865 $dir = File::Temp->newdir( $template, %options );
2879 $filename = $tmp->filename;
2891 $dirname = $tmpdir->dirname;
2900 $fh->unlink_on_destroy( 1 );
2921 directory is your current directory, it cannot be removed - a warning
2969 Equivalent to specifying a DIR of "File::Spec->tmpdir", writing the file
2983 Use the object-oriented interface if fine-grained control of when
3083 $tempdir = tempdir ( $template, DIR => File::Spec->tmpdir);
3179 This section describes the re-implementation of the tmpnam()
3356 mean that the post-unlink comparison of the filehandle state provided
3426 Will not work on platforms that do not support the C<-k> test
3446 File::Temp->safe_level( File::Temp::HIGH );
3467 $newlevel = File::Temp->safe_level( File::Temp::HIGH );
3486 File::Temp->top_system_uid(10);
3487 my $topid = File::Temp->top_system_uid;
3533 arbitrary programs. Perl code that uses the 2-argument version of
3536 close-on-exec bit on that file descriptor before passing it to another
3541 or die "Can't clear close-on-exec flag on temp fh: $!\n";
3610 See L<File::Tempdir> for an alternative object-oriented wrapper for
3617 …submitted through L<the RT bug tracker|https://rt.cpan.org/Public/Dist/Display.html?Name=File-Temp>
3618 (or L<bug-File-Temp@rt.cpan.org|mailto:bug-File-Temp@rt.cpan.org>).
3621 L<http://lists.perl.org/list/cpan-workers.html>.