develooper Front page | perl.perl5.porters | Postings from December 2013

[perl #114818] Replace unlink with unlink_all

Thread Next
From:
James E Keenan via RT
Date:
December 15, 2013 14:16
Subject:
[perl #114818] Replace unlink with unlink_all
Message ID:
rt-4.0.18-27367-1387117000-1779.114818-15-0@perl.org
On Tue Sep 11 11:14:13 2012, brad wrote:
> On Mon, Sep 10, 2012 at 8:29 PM, James E Keenan via RT
> <perlbug-followup@perl.org> wrote:
> > On Sun Sep 09 19:26:44 2012, b2gills@gmail.com wrote:
> >> I've looked for tests that require test.pl that use unlink(), and
> >> replaced many of them with unlink_all()
> >>
> >> unlink_all() is effectively the same as 1 while unlink() except with
> >> a
> >> diagnostic if it fails
> >>
> >> I have more changes to submit, but I wanted to get the obvious
> >> changes
> >> in first.
> >>
> >
> > Thank you for these patches.  You seem to be a bit uncertain about
> > something in 0006-Replace-unlink-with-unlink_all-in-t-win32-
> > runenv.t.patch:
> >
> > ##########
> > # This is slightly expensive, but this is more reliable than
> > # trying to emulate fork(), and we still get STDERR and STDOUT
> > individually.
> > +
> > +  # XXX (CHECK)
> > +  # can tmpnam() from File::Temp be replaced with tempfile() from
> > test.pl?
> > +  # look at t/run/runenv.t
> > +  # If so you can also remove require File::Temp above
> > +  # and unlink_all below
> > my $stderr_cache = tmpnam();
> > my $stdout = `$PERL @$args 2>$stderr_cache`;
> > my $stderr = '';
> > @@ -63,7 +69,8 @@ sub runperl_and_capture {
> >     $stderr .= $s_line;
> >   }
> >   close $stderr_cache_fh;
> > -    unlink $stderr_cache;
> > +    # XXX remove the following line, if using tempfile() from
> > test.pl
> > +    unlink_all $stderr_cache;
> > }
> > ##########
> >
> > ---
> > via perlbug:  queue: perl5 status: new
> > https://rt.perl.org:443/rt3/Ticket/Display.html?id=114818
> 
> 1. I haven't had the wherewithal to check if it can be swapped.
> 
> 2. I am actually confident that those other changes can be done at the
> same time.
> 
> 3. I forgot to remove those comments with 'git add -e
> t/win32/runenv.t'
> 
> 4. My next set of changes may have to do with tempfile(), so I'll look
> into it then.

Brad, could we get an update on the status of this ticket?

Thank you very much.
Jim Keenan


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=114818

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About