[BFAV] Ensure:ing a close

Frank Shearar Frank.Shearar at rnid.org.uk
Thu Sep 2 15:00:53 UTC 2004


While looking at Karl Ramberg's recent bug report, I saw something in ArchiveRepository>>updateListing that puzzled me. I saw this:

	listingFile _ self listingFile.
	listingFile findStringFromEnd: String cr, self archive highestPostId asString.
	listingFile next.
	listingFile upTo: Character cr.  "jump to the line after the highest id"
	listingDeltaString _ listingFile upToEnd.
	listingFile close.

"self listingFile" returns a File (from "self repositoryDir readOnlyFileNamed: self listingFileName"), so shouldn't I rewrite this as:

	listingFile := self listingFile.
	[listingFile findStringFromEnd: String cr, self archive highestPostId asString.
	listingFile next.
	listingFile upTo: Character cr.  "jump to the line after the highest id"
	listingDeltaString := listingFile upToEnd.] ensure: [listingFile close.]

?

frank


*******************************************************************
This email and any files transmitted with it are confidential
and intended solely for the use of the individual or entity to
whom they are addressed. Any views or opinions expressed
are solely those of the author and do not necessarily represent
RNID policy.
If you are not the intended recipient you are advised that any
use, dissemination, forwarding, printing or copying of this
email is strictly prohibited.
If you have received this email in error please notify the RNID
Helpdesk by telephone on: +44 (0) 207 296 8282.
The Royal National Institute for Deaf People
Registered Office 19*23 Featherstone Street
London EC1Y 8SL No. 454169 (England)
Registered Charity No. 207720
********************************************************************




More information about the Squeak-dev mailing list