<body><div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
Hi Christoph --<div><br></div><div>This looks strange. Why shouldn't this work on Windows? What's your explanation? Let's not fix the symptom but the cause, please.</div><div><br></div><div>-1</div><div><br></div><div>Best,</div><div>Marcel</div><div class="mb_sig"></div><blockquote class='history_container' type='cite' style='border-left-style:solid;border-width:1px; margin-top:20px; margin-left:0px;padding-left:10px;'>
<p style='color: #AAAAAA; margin-top: 10px;'>Am 10.01.2022 22:44:42 schrieb christoph.thiede@student.hpi.uni-potsdam.de <christoph.thiede@student.hpi.uni-potsdam.de>:</p><div style='font-family:Arial,Helvetica,sans-serif'>
Hi Dave, hi all,<br>
<br>
please take a short look at this changeset that I would like to merge into the Trunk in order to fix the DoItTest for Windows. Currently, some of them fail because DoItFirst tries to re-open the source files.<br>
<br>
<b><span style="font-family: Bitmap DejaVu Sans">=============== Summary ===============</span></b><span style="font-family: Bitmap DejaVu Sans"><br>
<br>
Change Set: DoItFirstAfterStartup<br>
Date: 10 January 2022<br>
Author: Christoph Thiede<br>
<br>
This changeset fixes the DoItFirst tests on Windows by making sure that no attempt is made to re-open the source fiels while the image has already been started up. This is achieved by extracting FileDirectory startUpDefaultDirectory from FileDirectory startUp and only sending the latter from DoItFirst >> #parse:.<br>
<br>
</span><b><span style="font-family: Bitmap DejaVu Sans">=============== Diff ===============</span></b><span style="font-family: Bitmap DejaVu Sans"><br>
<br>
</span><b><span style="font-family: Bitmap DejaVu Sans">DoItFirst>>parse: {evaluating} · ct 1/10/2022 22:37 (changed)</span></b><span style="font-family: Bitmap DejaVu Sans"><br>
</span><span style="font-family: Bitmap DejaVu Sans">parse: argumentList<br>
"Iterate over the argument list, creating actions blocks. Register each action<br>
block in the actions dictionary, and collect a list of the actions blocks to be<br>
evaluated now. If any action blocks will require files or directory initialization,<br>
send the appropriate startUp messages. Answer the list of action blocks to<br>
be evaluated."<br>
<br>
| args listOfBlocks needsFiles needsDirectory |<br>
needsFiles := needsDirectory := false.<br>
args := argumentList readStream.<br>
listOfBlocks := OrderedCollection new.<br>
[ args atEnd ] whileFalse: [ | key |<br>
(key := self keyFor: args next) caseOf: {<br>
[ #help ] -> [ self addFirst: [ self help ] to: listOfBlocks at: key. needsFiles := true] .<br>
[ #debug ] -> [ self addWithoutEvaluation: [ self debug ] at: key] .<br>
[ #doit ] -> [ | list | list := self nextTokensFrom: args. self add:[ self doIt: list ] to: listOfBlocks at: key. needsFiles := true] .<br>
[ #evaluate ] -> [ | arg | arg := args next. self add:[ self evaluateOption: arg ] to: listOfBlocks at: key. needsFiles := true] .<br>
[ #file ] -> [ | arg | arg := args next. self add:[ self evaluateFileContents: arg ] to: listOfBlocks at: key. needsFiles := true] .<br>
[ #filein ] -> [ | list | list := self nextTokensFrom: args. self add:[ self fileIn: list ] to: listOfBlocks at: key. needsFiles := needsDirectory := true] .<br>
[ #cwd ] -> [ | arg | arg := args next. self addFirst:[ self cwd: arg ] to: listOfBlocks at: key. needsFiles := needsDirectory := true] .<br>
} otherwise: [] ].<br>
needsFiles ifTrue: [ FileStream startUp: true. "initialize stdout and stderr" ].<br>
</span><s><span style="color: #0000FF"><font face="Bitmap DejaVu Sans" size="9">- needsDirectory ifTrue: [ FileDirectory startUp "set default directory" ].<br>
</font></span></s><span style="color: #FF0000"><font face="Bitmap DejaVu Sans" size="9">+ needsDirectory ifTrue: [ FileDirectory startUpDefaultDirectory ].<br>
</font></span><span style="font-family: Bitmap DejaVu Sans"> ^ listOfBlocks.<br>
</span><span style="font-family: Bitmap DejaVu Sans"><br>
<br>
</span><b><span style="font-family: Bitmap DejaVu Sans">FileDirectory class>>startUp {name utilities} · ct 1/10/2022 22:37 (changed)</span></b><span style="font-family: Bitmap DejaVu Sans"><br>
</span><span style="font-family: Bitmap DejaVu Sans">startUp<br>
</span><s><span style="color: #0000FF"><font face="Bitmap DejaVu Sans" size="9">- "Establish the platform-specific FileDirectory subclass. Do any platform-specific startup."<br>
- self setDefaultDirectoryClass.<br>
</font></span></s><span style="font-family: Bitmap DejaVu Sans"><br>
</span><s><span style="color: #0000FF"><font face="Bitmap DejaVu Sans" size="9">- self setDefaultDirectory: (self dirPathFor: Smalltalk imageName).<br>
- <br>
- Preferences startInUntrustedDirectory <br>
- ifTrue:[ "The SecurityManager may override the default directory to prevent unwanted write access etc."<br>
- self setDefaultDirectory: SecurityManager default untrustedUserDirectory.<br>
- "Make sure we have a place to go to"<br>
- DefaultDirectory assureExistence].<br>
</font></span></s><span style="color: #FF0000"><font face="Bitmap DejaVu Sans" size="9">+ self startUpDefaultDirectory.<br>
</font></span><span style="font-family: Bitmap DejaVu Sans"> Smalltalk openSourceFiles.<br>
</span><s><span style="color: #0000FF"><font face="Bitmap DejaVu Sans" size="9">- (Smalltalk classNamed: #DoItFirst) ifNotNil: [ :doit | doit perform: #reevaluateCwd ].<br>
</font></span></s><span style="font-family: Bitmap DejaVu Sans"><br>
<br>
</span><b><span style="font-family: Bitmap DejaVu Sans">FileDirectory class>>startUpDefaultDirectory {name utilities} · ct 1/10/2022 22:37</span></b><span style="font-family: Bitmap DejaVu Sans"><br>
</span><span style="color: #FF0000"><font face="Bitmap DejaVu Sans" size="9">+ startUpDefaultDirectory<br>
+ "Establish the platform-specific FileDirectory subclass. Do any platform-specific startup."<br>
+ <br>
+ self setDefaultDirectoryClass.<br>
+ self setDefaultDirectory: (self dirPathFor: Smalltalk imageName).<br>
+ <br>
+ Preferences startInUntrustedDirectory <br>
+ ifTrue:[ "The SecurityManager may override the default directory to prevent unwanted write access etc."<br>
+ self setDefaultDirectory: SecurityManager default untrustedUserDirectory.<br>
+ "Make sure we have a place to go to"<br>
+ DefaultDirectory assureExistence].<br>
+ <br>
+ (Smalltalk classNamed: #DoItFirst) ifNotNil: [ :doit | doit perform: #reevaluateCwd ].</font></span><span style="font-family: Bitmap DejaVu Sans"><br>
</span><br>
Best,<br>
Christoph<br>
<br>
<span style="color: #808080">---<br>
</span><span style="color: #808080"><i>Sent from </i></span><span style="color: #808080"><i><a href="https://github.com/hpi-swa-lab/squeak-inbox-talk"><u><font color="#808080">Squeak Inbox Talk</font></u></a></i></span><br>
["DoItFirstAfterStartup.1.cs"]
</div></blockquote>
</div></body>