[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] svn_load_dirs.pl patch for Win32

From: Ben Reser <ben_at_reser.org>
Date: 2004-05-04 19:43:51 CEST

On Mon, May 03, 2004 at 11:38:05AM +0100, Ian Brockbank wrote:
> # Create a temporary directory for svn to work in.
> my $temp_dir = $ENV{TMPDIR};
> unless (defined $temp_dir and length $temp_dir) {
> + # Try the Windows standard environment variable
> + $temp_dir = $ENV{TEMP};
> +}
> +unless (defined $temp_dir and length $temp_dir) {
> $temp_dir = '/tmp';
> }

I'd prefer that we ditch this code entirely and ...

> + # Write the value to a temporary file in case it's
> multi-line
> + my ($handle, $tmpfile) = tempfile( DIR => $temp_dir);
> + print $handle $property_value;
> + close($handle);

use TMPDIR => 1 instead of DIR => $temp_dir. Doing this causes
File::Temp to figure out the temp directory for us using File::Spec.
Considering that File::Spec contains implementations for a variety of
platforms not just Windows and Unix, this would end up being a lot more
portable...

-- 
Ben Reser <ben@reser.org>
http://ben.reser.org
"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue May 4 19:44:11 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.