<html><head></head><body bgcolor="#FFFFFF"><div><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); ">On 06.06.2012, at 20:19, Ajay Garg <<a href="mailto:ajaygargnsit@gmail.com">ajaygargnsit@gmail.com</a>> wrote:</span><br></div><div><br></div><div></div><blockquote type="cite"><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><div><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); ">When a file was checked out from the datastore, an activity needs to delete it when it is done. Etoys deletes the file when the file object is released (using a finalizer). I guess the MPEGPlayer stores only the name, closes the file, and tries to re-open it from the same name. If the original file object has been garbage-collected already, the finalizer will have deleted the file. Thus, trying to re-open it will fail.</span><br></div>
</div></div></blockquote><div><br><br>I guess this is what is happening.<br><br><br>Some thoughts ::<br><br>a)<br>So, the reason that things work fine in the case of USB drives, is because there is always a reference to the file by the OS. Thus, the file itself is never deleted.<br></div></div></div></blockquote><div><br></div>Yes.<div><br></div><div><br><blockquote type="cite"><div><div class="gmail_quote"><div>b)<br>More importantly, WHY WOULD MPEGPLAYER NEED TO DELETE THE FILE? CAN THE FILE SIMPLY NOT BE ACCESSED IN A UNIFORM MANNER FROM BOTH JOURNAL AND USB PEN DRIVES?<br>As part of this, I tried using the journal file simply (without making its copy). So, now "Rewind" worked. But the next time, "Rewind" did not work, apparently because the file was deleted.<br>
<br><br>So,<br><u><i><b>WHY WOULD MPEGPLAYER NEED TO DELETE THE FILE? CAN THE FILE SIMPLY NOT BE
 ACCESSED IN A UNIFORM MANNER FROM BOTH JOURNAL AND USB PEN DRIVES, WITHOUT HAVING THE NEED TO DELETE THE FILE ALTOGETHER?</b></i></u><br><br></div></div></div></blockquote><div><br></div><div>Because that is how the Sugar datastore works:</div><div><br></div><a href="http://wiki.sugarlabs.org/go/Development_Team/Low-level_Activity_API#Keeping_and_Resuming">http://wiki.sugarlabs.org/go/Development_Team/Low-level_Activity_API#Keeping_and_Resuming</a></div><div><br></div><div>When you call get_filename() on the datastore object, a copy is made by the datastore, which the activity needs to delete.</div><div><br></div><div>And it's not the MPEG player which deletes the file, but SugarLauncher.</div><div><br><blockquote type="cite"><div><div class="gmail_quote"><div>On an unrelated note :: Thanks a ton for the tutorials on  squeak. I could finally do some live debugging :D :D<br>
Thanks again.<br><br>Thanks and Regards,<br>Ajay</div></div>
</div></blockquote><br></div><div>Hehe. Be careful, you may like what you learn ;)</div><div><br></div><div>(in that case, you should maybe get someone to send you to the Smalltalks conference in Argentina in November)</div><div><br></div><div>- Bert -</div></body></html>