'From Squeak3.1alpha of 4 February 2001 [latest update: #3641] on 18 February 2001 at 11:21:37 pm'! "Change Set: SrcFileTweaks-ar Date: 18 February 2001 Author: Andreas Raab Fixes an error when changes file is absent. Fixes an error when attempting to saveAs with no changes file present."! !FileDirectory class methodsFor: 'system start up' stamp: 'ar 2/18/2001 23:20'! openSources: sourcesName andChanges: changesName forImage: imageName "Initialize the default directory to the image directory and open the sources and changes files, if possible. Look for the changes file in image directory. Look for the system sources (or an alias to it) first in the VM directory, then in the image directory. Open the changes and sources files and install them in SourceFiles." "Note: SourcesName and imageName are full paths; changesName is a local name." | sources changes msg wmsg | msg _ 'Squeak cannot locate &fileRef. Please check that the file is named properly and is in the same directory as this image. Further explanation can found in the startup window, ''How Squeak Finds Source Code''.'. wmsg _ 'Squeak cannot write to &fileRef. Please check that you have write permission for this file. You won''t be able to save this image correctly until you fix this.'. sources _ self openSources: sourcesName forImage: imageName. changes _ self openChanges: changesName forImage: imageName. ((sources == nil or: [sources atEnd]) and: [Preferences valueOfFlag: #warnIfNoSourcesFile]) ifTrue: [PopUpMenu notify: (msg copyReplaceAll: '&fileRef' with: 'the sources file named ' , sourcesName). Smalltalk platformName = 'Mac OS' ifTrue: [PopUpMenu notify: 'Make sure the sources file is not an Alias.']]. (changes == nil and: [Preferences valueOfFlag: #warnIfNoChangesFile]) ifTrue: [PopUpMenu notify: (msg copyReplaceAll: '&fileRef' with: 'the changes file named ' , changesName)]. ((Preferences valueOfFlag: #warnIfNoChangesFile) and:[changes notNil]) ifTrue: [ changes isReadOnly ifTrue:[ PopUpMenu notify: (wmsg copyReplaceAll: '&fileRef' with: 'the changes file named ' , changesName)]. ((changes next: 200) includesSubString: String crlf) ifTrue: [ PopUpMenu notify: 'The changes file named ' , changesName, ' has been injured by an unpacking utility. Crs were changed to CrLfs. Please set the preferences in your decompressing program to "do not convert text files" and unpack the system again.']]. SourceFiles _ Array with: sources with: changes! ! !SystemDictionary methodsFor: 'snapshot and quit' stamp: 'ar 2/18/2001 23:20'! saveAs | newName | newName _ self getFileNameFromUser. newName isNil ifTrue:[^self]. (SourceFiles at: 2) ifNotNil:[ self saveChangesInFileNamed: (self fullNameForChangesNamed: newName)]. self saveImageInFileNamed: (self fullNameForImageNamed: newName); logChange: '----SAVEAS ', newName, '----', Date dateAndTimeNow printString. ! !