[squeak-dev] Re: Loading in-memory Project file
Andreas Raab
andreas.raab at gmx.de
Sat Aug 22 20:41:41 UTC 2009
Ian Trudel wrote:
> I have seen that a new Release Builder for 3.11 has been added to the
> trunk by Andreas. We have been talking that it would be interesting to
> be able to modify the main project for the trunk image. I did some
> code to load a project file into a class variable (to make sure it is
> in a change set/monticello package).
Just a small correction: The Release Builder had always been there. For
some unexplicable reason I didn't add it to the original configuration
and I only noticed it when I added ShoutCore.
> However, I would like to know how to load a project file in memory.
> That is without having to resave the file on disk and load it again.
> Or, I'd be interested to know if there is a way to save and load
> in-memory (without files at all).
Try this:
"Create new project on disk"
Project current
exportSegmentFileName: 'test.pr'
directory: FileDirectory default.
"Load data back into memory"
data := (FileDirectory default readOnlyFileNamed: 'test.pr')
binary contentsOfEntireFile.
"Create stream from data"
stream := MultiByteBinaryOrTextStream with: data.
stream reset.
"Load and Enter project"
ProjectLoading
openName: nil
stream: stream
fromDirectory: nil
withProjectView: nil.
> My idea is to write a task in Release Builder to load the project,
> enter it and remove all other projects.
Sounds great.
Cheers,
- Andreas
More information about the Squeak-dev
mailing list
|