Skip Menu |

This queue is for tickets about the Directory-Scratch CPAN distribution.

Report information
The Basics
Id: 21203
Status: resolved
Priority: 0/
Queue: Directory-Scratch

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.06
Fixed in: (no value)



Subject: Enhance RATIONALE in Pod
Here are the snippets from my annocpan annotations, not a formal patch. I'll left the final labour to the author... I think there's need for a better rationale. The problems mentioned here are solved by the standard perl module File::Temp: $TESTDIR = tempdir(TMPDIR => 1, CLEANUP => 1) ---------------------------------------------------------------------- use File::Temp qw(tempdir); use File::Spec::Functions qw(catfile); my $TMPDIR = tempdir(CLEANUP => 1, TMPDIR => 1); for (1..5) { my $tmpfile = catfile($TMPDIR, "tempfile.$_"); open my $fh, ">", $tmpfile or die $!; warn $tmpfile; my $tmpdir = catfile($TMPDIR, "tempdir.$_"); mkdir $tmpdir or die $!; warn $tmpdir; } __END__ My point is: the cleanup functionality is already there in File::Temp. You should really use an example using File::Temp to compare with Directory::Scratch. This will make the difference smaller, sure. And if File::Temp does not work on exotic operating systems, then this should be described in this rationale (e.g. "File::Temp is broken on VMS, Win, ..."). Also, make the two examples equivalent. The first example writes something to the opened file, while the second does not do so. So the three lines in the first example could be squeezed to just one. I won't debate about the introduction of "touch" or similar methods. This indeed looks nicer than using open. And it's also nice that it's not necessary to use File::Spec::catfile. ------------------------------------------------------------------- Regards, Slaven
From: JROCKWAY [...] cpan.org
Thanks; I added this as r34. (repo is at svn://svn.jrock.us/cpan_modules/Directory-Scratch) Regards, Jonathan Rockway Show quoted text
> Here are the snippets from my annocpan annotations, not a formal patch. > I'll left the final labour to the author... > > I think there's need for a better rationale. The problems mentioned here > are solved by the standard perl module File::Temp: > > $TESTDIR = tempdir(TMPDIR => 1, CLEANUP => 1) > > ---------------------------------------------------------------------- > > use File::Temp qw(tempdir); > use File::Spec::Functions qw(catfile); > my $TMPDIR = tempdir(CLEANUP => 1, TMPDIR => 1); > for (1..5) { > my $tmpfile = catfile($TMPDIR, "tempfile.$_"); > open my $fh, ">", $tmpfile or die $!; > warn $tmpfile; > my $tmpdir = catfile($TMPDIR, "tempdir.$_"); > mkdir $tmpdir or die $!; > warn $tmpdir; > } >
Subject: Re: [rt.cpan.org #21203] Resolved: Enhance RATIONALE in Pod
Date: 29 Aug 2006 23:18:24 +0200
To: bug-Directory-Scratch [...] rt.cpan.org
From: Slaven Rezic <slaven [...] rezic.de>
"Jonathan Rockway via RT" <bug-Directory-Scratch@rt.cpan.org> writes: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=21203 > > > According to our records, your request has been resolved. If you have any > further questions or concerns, please respond to this message. >
One more nitpick: the File::Temp example has different variables for the file: $FILE and $file And probably touch does not append "\n" at the end of the content, so the other example also shouldn't. Regards, Slaven -- Slaven Rezic - slaven <at> rezic <dot> de tksm - Perl/Tk program for searching and replacing in multiple files http://ptktools.sourceforge.net/#tksm