Fixes for pathname

Chris Muller afunkyobject at yahoo.com
Fri Aug 4 03:41:09 UTC 2006


Excellent.  Thanks Keith, I have merged these changes and they will be
in the very next (queries beta) release.

PS - For some reason, your file-out did not have Squeak carriage
returns (13), just line-feeds I think.  Normally I would NEVER reformat
someones code but, in this case 1) I think you intended for it to be
formatted, 2) it was butt-ugly unformatted.  :)

 - Chris

--- Keith Hodges <Keith.Hodges at warwick.ac.uk> wrote:

> I am continuing the quest to allow pathnames relative to the image
> for
> the repository in order to make things more portable. Fixes attached
> for
> repository create/delete.
> 
> 
> best regards
> 
> Keith
> > 'From Squeak3.8 of ''5 May 2005'' [latest update: #6665] on 4
August
> 2006 at 1:29:33 am'!
> 
> !MagmaRepositoryController class methodsFor: 'utilities' stamp: 'kph
> 8/4/2006 01:27'!
> create: localNameOrFullyQualifiedPathString
> 	"Creates a repository with an initial root of nil.  I
> #assureExistence of the localNameOrFullyQualifiedPathString."
> 
> 	| fd |
> 
> 	fd _ FileDirectory on: (FileDirectory default fullNameFor:
> localNameOrFullyQualifiedPathString).
> 
> 	self validateCanCreateIn: fd.
> 	self new createRepositoryAt: fd! !
> 
> !MagmaRepositoryController class methodsFor: 'utilities' stamp: 'kph
> 8/4/2006 01:26'!
> delete: localNameOrFullyQualifiedPathString
> 	"Delete the just the files in fullyQualifiedPathString that are part
> of the Magma repository that resides there."
> 	| fd |
> 
> 	fd _ FileDirectory on: (FileDirectory default fullNameFor:
> localNameOrFullyQualifiedPathString).
> 
> 	(fd exists and: [ fd fileExists: MaObjectFiler objectsFilename ])
> ifFalse:
> 		[ (MagmaNotification new messageText: fd pathName , ' does not
> exist, nothing to delete.') signal.
> 		^ self ].
> 	(self filesFor: fd pathName), { (MaRecoveryManager
> commitPackagesFilename) } do:
> 		[ : each |
> 			fd deleteFileNamed: each asString
> 			ifAbsent: [ MagmaNotification signal: 'Couldn''t find ' , each
> asString ] ]! !
> 
> > _______________________________________________
> Magma mailing list
> Magma at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/magma
> 



More information about the Magma mailing list