Front page | perl.perl5.porters |
Postings from April 2003
[perl #21937] open $x,$y,undef; should use File::Temp
From:
perlbug-followup
Date:
April 10, 2003 17:52
Subject:
[perl #21937] open $x,$y,undef; should use File::Temp
Message ID:
rt-21937-54830.5.38205761908969@bugs6.perl.org
# New Ticket Created by gnat@nathan-torkingtons-computer.local
# Please include the string: [perl #21937]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=21937 >
This is a bug report for perl from gnat@nathan-torkingtons-computer.local.,
generated with the help of perlbug 1.34 running under perl v5.8.0.
-----------------------------------------------------------------
[Please enter your report here]
You can now say:
open $fh, "+>", undef;
to create a temporary file for reading and writing. However,
internally this just uses mkstemp(). Perl comes with a File::Temp
module that works even when your system doesn't have mkstemp() or
has a race-condition-prone mkstemp().
There's an element of recursion here because File::Temp calls
open() to open the file, but the key is that it's not unbounded
recursion because when File::Temp calls open() it does so with a
concrete filename and not "undef".
[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
category=core
severity=medium
---
Site configuration information for perl v5.8.0:
Configured by gnat at Wed Feb 5 16:24:34 MST 2003.
Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
Platform:
osname=darwin, osvers=6.3, archname=darwin
uname='darwin nathan-torkingtons-computer.local. 6.3 darwin kernel version 6.3: sat dec 14 03:11:25 pst 2002; root:xnuxnu-344.23.obj~4release_ppc power macintosh powerpc '
config_args='-der'
hint=previous, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-pipe -fno-common -no-cpp-precomp -fno-strict-aliasing',
optimize='-O3',
cppflags='-no-cpp-precomp -pipe -fno-common -no-cpp-precomp -fno-strict-aliasing -pipe -fno-common -no-cpp-precomp -fno-strict-aliasing -pipe -fno-common -no-cpp-precomp -fno-strict-aliasing'
ccversion='', gccversion='3.1 20020420 (prerelease)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -flat_namespace'
libpth=/usr/lib
libs=-lm -lc
perllibs=-lm -lc
libc=/usr/lib/libc.dylib, so=dylib, useshrplib=true, libperl=libperl.dylib
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dyld.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags=' -flat_namespace -bundle -undefined suppress'
Locally applied patches:
---
@INC for perl v5.8.0:
/usr/local/perl5-8/Library/Perl/5.8.0/darwin
/usr/local/perl5-8/Library/Perl/5.8.0
/usr/local/perl5-8/Library/Perl/5.8.0/darwin
/usr/local/perl5-8/Library/Perl/5.8.0
/usr/local/perl5-8/Library/Perl
/usr/local/perl5-8/Network/Library/Perl/5.8.0/darwin
/usr/local/perl5-8/Network/Library/Perl/5.8.0
/usr/local/perl5-8/Network/Library/Perl
.
---
Environment for perl v5.8.0:
DYLD_LIBRARY_PATH (unset)
HOME=/Users/gnat
LANG (unset)
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=/usr/local/perl5-8/bin:/sw/bin:/sw/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/Users/gnat/bin:/usr/local/bin
PERL_BADLANG (unset)
SHELL=/bin/tcsh
-
[perl #21937] open $x,$y,undef; should use File::Temp
by perlbug-followup