Re: [PATCH] gitweb: Support caching projects list
- From
Jay Soffian <jaysoffian@gmail.com>
- Date
- Mar 14, 2008, 21:11 UTC
- Message-ID
- <76718490803141411v24c31de5x8ba25fcd1654b4e7@mail.gmail.com>
- In-Reply-To
- <m38x0lxr1k.fsf@localhost.localdomain>
On Fri, Mar 14, 2008 at 11:29 AM, Jakub Narebski <jnareb@gmail.com> wrote:
Show 8 quoted lines
> What should the code for this look like? Like below? > > use File::Temp; > > my ($fh, $temp_file) = tempfile(); > ... > close $fh; > rename $temp_file, $cache_file;
I always use something like:
my $temp_file = "$cache_file.tmp$$"; open(my $fh, ">$temp_file");
to ensure that the temp file is on the same filesystem.
j.