Skip to Content.
Sympa Menu

devel - Re: [sympa-developpers] [sympa-commits] sympa[9629] branches/sympa-cleanup/src/lib/Sympa/Spool/File.pm: [dev] use slurp_file function for reading file content

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: David Verdin <address@concealed>
  • To: address@concealed
  • Subject: Re: [sympa-developpers] [sympa-commits] sympa[9629] branches/sympa-cleanup/src/lib/Sympa/Spool/File.pm: [dev] use slurp_file function for reading file content
  • Date: Tue, 23 Jul 2013 10:32:50 +0200

I love the name of this function!

I must have missed it, otherwise I would probably have started using it before.

Le 23/07/13 09:44, address@concealed a écrit :
sympa[9629] branches/sympa-cleanup/src/lib/Sympa/Spool/File.pm: [dev] use slurp_file function for reading file content
Revision
9629
Author
rousse
Date
2013-07-23 09:44:45 +0200 (mar. 23 juil. 2013)

Log Message

[dev] use slurp_file function for reading file content

Modified Paths

  • branches/sympa-cleanup/src/lib/Sympa/Spool/File.pm

Diff

Modified: branches/sympa-cleanup/src/lib/Sympa/Spool/File.pm (9628 => 9629)


--- branches/sympa-cleanup/src/lib/Sympa/Spool/File.pm	2013-07-23 06:58:39 UTC (rev 9628)
+++ branches/sympa-cleanup/src/lib/Sympa/Spool/File.pm	2013-07-23 07:44:45 UTC (rev 9629)
@@ -507,16 +507,7 @@
 	my $self = shift;
 	my $key  = shift;
 
-	my $fh;
-	unless (open $fh, $self->{'dir'}.'/'.$key) {
-		Sympa::Log::Syslog::do_log('err', 'Unable to open file %s: %s',
-			$self->{'dir'}.'/'.$key, $ERRNO);
-		return undef;
-	}
-	local $RS;
-	my $messageasstring = <$fh>;
-	close $fh;
-	return $messageasstring;
+	return Sympa::Tools::File::slurp_file($self->{'dir'}.'/'.$key);
 }
 
 =item $spool->lock_message($key)

--
A bug in Sympa? Quick! To the bug tracker!

 
David Verdin
Infrastructure pour les Services Informatiques
 

Tél : +33 2 23 23 69 71
Fax : +33 2 23 23 71 21
 

www.renater.fr
RENATER
263 Avenue du Gal Leclerc
35042 Rennes Cedex



PNG image

Attachment: smime.p7s
Description: Signature cryptographique S/MIME




Archive powered by MHonArc 2.6.19+.

Top of Page