[Squeak] AIDASite>>backupToFIle

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Squeak] AIDASite>>backupToFIle

Nicolas Petton
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
--
Nicolas Petton
http://nico.bioskop.fr
            ___
          ooooooo
         OOOOOOOOO
        |Smalltalk|
         OOOOOOOOO
          ooooooo
           \   /
            [|]
--------------------------------
Ma clé GPG est disponible ici :
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE788C34D

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Squeak] AIDASite>>backupToFIle

Janko Mivšek
Nicolas, looks like original VW methods. Would you explain your
backup/restore a bit more? 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
> [hidden email]
> http://lists.aidaweb.si/mailman/listinfo/aida

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: [Squeak] AIDASite>>backupToFIle

Nicolas Petton

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?
Well, it does the same as VW code.
> Is this kind of object fileout/filein, like
> BOSS (Binary Object Storage) in VW?
Yes
>  What is backed, only this site or more?
The site is backed, and all recursive objects.
> This code works already?
Yes, I think (but you can try it by yourself, I didn't test it a lot)

Nicolas

>
> 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
> > [hidden email]
> > http://lists.aidaweb.si/mailman/listinfo/aida
>

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Squeak] AIDASite>>backupToFIle

Nicolas Petton
In reply to this post by Janko Mivšek

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
> > [hidden email]
> > http://lists.aidaweb.si/mailman/listinfo/aida
>

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida

signature.asc (196 bytes) Download Attachment