<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 31.07.2011, at 20:55, Eliot Miranda wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi Bert,<br><br><div class="gmail_quote">On Sun, Jul 31, 2011 at 10:52 AM, Bert Freudenberg <span dir="ltr"><<a href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; ">
<div class="im"><br>
<br>
On 31.07.2011, at 19:18, Eliot Miranda wrote:<br>
<br>
> Hi All,<br>
><br>
> I just added code to the Cog branch for the Mac VM so that whether primVmPath/primitiveVMPath answers the directory containing the VM.app or answers the Resources directory within the .app is controlled by the SqueakVMPathAnswersResources preference in the Info.plist file. primVmPath is used to determine where to derive the sources file from.<br>
<br>
</div>Among other places.<br>
<div class="im"><br>
> By default primVmPath answers the directory containing the VM.app and therefore the sources file is at the same level, e.g. /Applications/Squeak.app & /Applications/SqueakV41.sources. But some installations (e.g. Newspeak and the EToys all-in-one) may find it more convenient to put the sources in VM.app/Contents/Resources.<br>
<br>
</div>That's what Etoys does, of course.<br>
<div class="im"><br>
> This means one file to install, not 2, etc. I think it useful that this behavior be in the standard VM. Esteban, if you agree, perhaps you could integrate into the trunk platforms/Mac OS?<br>
<br>
</div>Not opposed to the change, but it's unnecessary for all-in-ones like Etoys. The Squeak logic to open the sources file looks in the image directory anyway, which is the Resources folder.<br></blockquote><div><br>
</div><div>I didn't find this code when I looked yesterday. Can you spell this out for me?</div></div></blockquote><div><br></div><div>FileDirectory class>>openSources:forImage: {system start up}</div><div>tpr 2/17/2004 19:59 </div><div><br></div><div>openSources: fullSourcesName forImage: imageName </div><div>"We first do a check to see if a compressed version ofthe sources file is present.</div><div>Open the .sources file read-only after searching in:</div><div>a) the directory where the VM lives</div><div>b) the directory where the image came from</div><div>c) the DefaultDirectory (which is likely the same as b unless the SecurityManager has changed it).</div><div>"</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>| sources fd sourcesName |</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>(fullSourcesName endsWith: 'sources') ifTrue:</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>["Look first for a sources file in compressed format."</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>sources _ self openSources: (fullSourcesName allButLast: 7) , 'stc'</div><div><span class="Apple-tab-span" style="white-space:pre">                                                </span>forImage: imageName.</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>sources ifNotNil: [^ CompressedSourceStream on: sources]].</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>sourcesName _ FileDirectory localNameFor: fullSourcesName.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>"look for the sources file or an alias to it in the VM's directory"</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>fd _ FileDirectory on: SmalltalkImage current vmPath.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>(fd fileExists: sourcesName)</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>ifTrue: [sources _ fd readOnlyFileNamed: sourcesName].</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>sources ifNotNil: [^ sources].</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>"look for the sources file or an alias to it in the image directory"</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>fd _ FileDirectory on: (FileDirectory dirPathFor: imageName).</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>(fd fileExists: sourcesName)</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>ifTrue: [sources _ fd readOnlyFileNamed: sourcesName].</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>sources ifNotNil: [^ sources].</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>"look for the sources in the current directory"</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>fd _ DefaultDirectory.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>(fd fileExists: sourcesName)</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>ifTrue: [sources _ fd readOnlyFileNamed: sourcesName].</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>"sources may still be nil here"</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>^sources</div></div><div><br></div><br><div>
<div style="font-family: Helvetica; font-size: 12px; ">- Bert -</div><span class="Apple-style-span" style="font-family: 'Lucida Grande'; font-size: 12px; "><br class="Apple-interchange-newline"></span>
</div>
<br></body></html>