'From etoys3.0 of 19 February 2008 [latest update: #1902] on 21 February 2008 at 5:32:19 pm'! "Change Set: changesFix-bf Date: 21 February 2008 Author: Bert Freudenberg Change #changesName to be a full path derived from image name, just like #imageName and #sourcesName. This makes more code work even if the changes are not in the default directory."! !FileDirectory class methodsFor: 'system start up' stamp: 'bf 2/21/2008 17:31'! openChanges: fullChangesName forImage: imageName "find the changes file by looking in a) the directory derived from the image name b) the DefaultDirectory (which will normally be the directory derived from the image name or the SecurityManager's choice) If an old file is not found in either place, check for a read-only file in the same places. If that fails, return nil" | changes imageDir changesName | "look for the changes file or an alias to it in the image directory" "fullChangesName is actually in the image directory" imageDir := FileDirectory on: (FileDirectory dirPathFor: imageName). [changes := imageDir oldFileNamed: fullChangesName] on: FileDoesNotExistException do: [:ex | ex return: nil]. changes ifNotNil:[^changes]. changesName := FileDirectory localNameFor: fullChangesName. "look for the changes in the default directory" [changes := DefaultDirectory oldFileNamed: changesName] on: FileDoesNotExistException do: [:ex | ex return: nil]. changes ifNotNil:[^changes]. "look for read-only changes in the image directory" [changes := imageDir readOnlyFileNamed: changesName] on: FileDoesNotExistException do: [:ex | ex return: nil]. changes ifNotNil:[^changes]. "look for read-only changes in the default directory" [changes := DefaultDirectory readOnlyFileNamed: changesName] on: FileDoesNotExistException do: [:ex | ex return: nil]. "this may be nil if the last try above failed to open a file" ^changes ! ! !SmalltalkImage methodsFor: 'image, changes names' stamp: 'bf 2/21/2008 16:57'! changesName "Answer the name for the changes file corresponding to the image file name." "SmalltalkImage current changesName" | imName | imName := FileDirectory baseNameFor: self imageName. ^ imName, FileDirectory dot, 'changes'! ! !SystemDictionary methodsFor: 'deprecated' stamp: 'bf 2/21/2008 16:57'! changesName "Answer the name for the changes file corresponding to the image file name." "Smalltalk changesName" self deprecated: 'Use SmalltalkImage current changesName'. ^SmalltalkImage current changesName! !