*Others and* Unix porters: do you recognize this one?

Tom Morgan tmorgan at acm.org
Wed Mar 18 02:20:22 UTC 1998


I made a posting last week, about troubles finding the
image and changes file, right after doing a 'save as'
on a Unix platform.

There is actually a small fix for this, which applies to 
all platforms.

Description
-----------
Revise the SystemDictionary>>saveAs method, to pass the complete file
pathname to the method SystemDictionary>>imageName:

The change causes the method FileDirectory>>default to maintain its
correct value following a 'saveAs'.

I have tried this on a Mac, W95 and Unix image, but the usual
cautions apply.

   ...Tom M 

PS
Andreas provided a good clue; as usual, spelunking in the browser
was very easy.


+---Tom Morgan ------------------------------ (tmorgan at acm.org) -----+
I   Brooklyn Union                          Phone: 1 718 403 2427    I
I   1 MetroTech Center                      Fax:   1 718 488 1752    I
+---Brooklyn, New York 11201 USA ------------------------------------+
'From Squeak 1.31 of Feb 4, 1998 on 15 March 1998 at 2:35:38 pm'!
"Change Set:		Patches
Date:			15 March 1998
Author:			Tom Morgan

This change set holds releaseable fixes to the Smalltalk base image."!


!SystemDictionary methodsFor: 'snapshot and quit' stamp: 'TEM 3/15/98 14:34'!
saveAs
	| dir newName imageSuffix changesSuffix |
	dir _ FileDirectory default.
	imageSuffix _ self fileNameEnds first.
	changesSuffix _ self fileNameEnds last.
	newName _ (FillInTheBlank request: 'New File Name?' initialAnswer: 'NewImageName') asFileName.
	(newName endsWith: imageSuffix)
		ifTrue: [newName _ newName copyFrom: 1 to: newName size - imageSuffix size].
	(dir includesKey: newName , imageSuffix)
		| (dir includesKey: newName , changesSuffix) ifTrue: [^ self notify: newName , ' is already in use
Please choose another name.'].
	dir copyFileNamed: self changesName toFileNamed: newName , changesSuffix.
	self logChange: '----SAVEAS ' , newName , '----' , Date dateAndTimeNow printString.
	"imageName expects fully qualifed name--->" self imageName: (dir fullNameFor: newName , imageSuffix).
	
	LastImageName _ self imageName.
	self closeSourceFiles; openSourceFiles.
	"Just so SNAPSHOT appears on the new file, and not the old"
	self snapshot: true andQuit: false! !





More information about the Squeak-dev mailing list