<div dir="ltr">The OLPC had quite a tricky file security system that gave you convoluted code.<div>I think that is some of the reason this code is there.</div><div><br></div><div>Karl</div></div><div class="gmail_extra"><br>
<br><div class="gmail_quote">On Fri, Apr 11, 2014 at 8:25 PM, tim Rowledge <span dir="ltr">&lt;<a href="mailto:tim@rowledge.org" target="_blank">tim@rowledge.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class=""><br>
On 11-04-2014, at 7:18 AM, Bert Freudenberg &lt;<a href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</a>&gt; wrote:<br>
<br>
&gt;<br>
&gt; On 10.04.2014, at 17:57, tim Rowledge &lt;<a href="mailto:tim@rowledge.org">tim@rowledge.org</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; I&rsquo;ve just had to fix up some code that handled file drops. Since it was easy to mooch off the code in PasteUpMorph, that&rsquo;s what I did - but I&rsquo;m wondering what the reason is for the rather convoluted code in StandardFileStream class&gt;requestDropStream:<br>

&gt;&gt;<br>
&gt;&gt; So far as I can tell the DropPlugin code provides a string representing the dropped file (along with the event carrying the number of files dropped etc) and then we immediately ask the plugin for an actual file handle. It&rsquo;s a bit hard to see why the plugin needs to do that since we can open a file easily enough in other ways. I can see from the *nix and Mac OS code that they are just opening files &lsquo;normally&rsquo; (and I agree with Ian&rsquo;s comment &nbsp;/* you cannot be serious? */ by the way). The win32 code is less intelligible but seems to be doing much the same. Does anyone remember why we ended up going to this trouble to do something the hard way instead of passing the client a filename? The code in ExternalDropHandler spends much of its time dealing with the filename anyway.<br>

&gt;<br>
&gt; I don&#39;t quite remember, but is it possible that dropped files might indeed need special handling in some cases? Like, if the OS gives you a handle to the file instead of just a file name. This does make sense when you think of the handle as a capability (as in capability-based security).<br>

<br>
</div>I thought that might have been the issue, but I can&rsquo;t see anything in the plugin code that really supports the theory. I wondered if may it had been a Mac thing - they (used to) have some pretty weird file related needs.<br>

<div class=""><br>
<br>
tim<br>
--<br>
tim Rowledge; <a href="mailto:tim@rowledge.org">tim@rowledge.org</a>; <a href="http://www.rowledge.org/tim" target="_blank">http://www.rowledge.org/tim</a><br>
</div>Strange OpCodes: CPE: Create Parity Error<br>
<br>
<br>
<br>
</blockquote></div><br></div>