[aida] [Squeak] AIDASite>>backupToFIle

Nicolas Petton petton.nicolas at gmail.com
Tue Jan 15 22:42:15 CET 2008


Le mardi 15 janvier 2008 à 22:34 +0100, Janko Mivšek a écrit :
> Nicolas, looks like original VW methods. Would you explain your 
> backup/restore a bit more? 
Instead of boss, I use FileStream>>fileOutClass:andObject:. This method
is used to save the source code of a class and an object in a binary
file. Here I choose to keep the object only.
> Is this kind of object fileout/filein, like 
> BOSS (Binary Object Storage) in VW? What is backed, only this site or more?
> 
> This code works already?
> 
> JAnko
> 
> Nicolas Petton wrote:
> > Hi,
> > 
> > The backup/restore feature is really nice, but the code doesn't seems to
> > be ported. So I replaced it with :
> > 
> > AIDASite>>backupToFile
> > 	| filename fileDir |
> > 	filename := 'aidasite-', self name, '.obj'.
> > 	fileDir := FileDirectory forFileName: filename.
> > 	(fileDir fileExists: filename) ifTrue: 
> > 		[fileDir copyFileWithoutOverwriteConfirmationNamed: filename
> > toFileNamed: ('aidasite-', self name, '-old.obj')].
> > 	(FileStream fileNamed: filename)
> > 		fileOutClass: nil andObject: self
> > 
> > 
> > AIDASite>>restoreSiteNamed: aString
> > 	| filename site |
> > 	filename := 'aidasite-', aString, '.obj'.
> > 	site := (FileStream fileNamed: filename) fileInObjectAndCode.
> > 	^site
> > 
> > I also think it would be nice to have backup files with dates. What do
> > you think ?
> > 
> > Cheers,
> > 
> > Nicolas 
> > 
> > 
> > ------------------------------------------------------------------------
> > 
> > _______________________________________________
> > Aida mailing list
> > Aida at aidaweb.si
> > http://lists.aidaweb.si/mailman/listinfo/aida
> 
-------------- section suivante --------------
Une pi�ce jointe non texte a �t� nettoy�e...
Nom: non disponible
Type: application/pgp-signature
Taille: 189 octets
Desc: Ceci est une partie de message
	=?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?=
Url: http://lists.aidaweb.si/pipermail/aida/attachments/20080115/7c5ab4ec/attachment-0001.sig 


More information about the Aida mailing list