<br><br><div class="gmail_quote">On Tue, Nov 30, 2010 at 5:22 PM, alexandre bp <span dir="ltr">&lt;<a href="mailto:abalonpe@ulb.ac.be">abalonpe@ulb.ac.be</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
You are right!<div>sorry I didn&#39;t know there were a different mailinglist for pharo.</div><div><br></div></blockquote><div><br>no problem, it was just for you, for me it is the same ;)<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div></div><div>cheers</div><div>alex<br><br><div class="gmail_quote">2010/11/30 Mariano Martinez Peck <span dir="ltr">&lt;<a href="mailto:marianopeck@gmail.com" target="_blank">marianopeck@gmail.com</a>&gt;</span><div><div>
</div><div class="h5"><br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Alexandre, maybe you will receive more answers if you ask directly in the pharo mailing list instead of seaside, since Files doesn&#39;t have anything to do with seaside ;)<br>


<br><a href="http://www.pharo-project.org/community" target="_blank">http://www.pharo-project.org/community</a><br>
<br><div class="gmail_quote"><div>On Mon, Nov 29, 2010 at 10:20 PM, alexandre bp <span dir="ltr">&lt;<a href="mailto:abalonpe@ulb.ac.be" target="_blank">abalonpe@ulb.ac.be</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">



Thank you very much for your help.<div>The thing is that, when I  first got the exception, I deleted  the file manually in the Pharo folder so I&#39;m pretty sure it doesn&#39;t exist.</div><div>

Maybe that when I do: &quot;aStream := FileStream newFileNamed:filename&quot; Pharo looks everywhere in my computer than it might find a file named &#39;test&#39; </div></blockquote></div><div><br>No, that shouldn&#39;t happen. What if you do  FileDirectory defaul newFileNamed: filename<br>



<br>does it work?<br><br>BTW..did you read Pharo by Example?  Because there is a whole chapter explaining Streams and files....I am very bad with them, I always forget how to do trivial things and I need to check there...<br>



<br><a href="http://pharobyexample.org/" target="_blank">http://pharobyexample.org/</a><br><br>Cheers<br><br>Mariano<br> </div><div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">



<div>or with a part of it named which is &#39;test&#39;...but the file was created in the Pharo folder so I assume it must look only there to find a file, no?</div></blockquote></div><div><br>yes<br> </div><div><div></div>


<div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


<div>alex</div><div><br><br><div class="gmail_quote">2010/11/28 Levente Uzonyi <span dir="ltr">&lt;<a href="mailto:leves@elte.hu" target="_blank">leves@elte.hu</a>&gt;</span><div><div></div><div><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">





<div>On Sat, 27 Nov 2010, alexandre bp wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br>
<br>
I&#39;m having trouble with the FileStream....<br>
<br>
I have tried several things:<br>
filename := &#39;test&#39;.<br>
aStream := StandardFileStream new.<br>
1) aStream := FileStream newFileNamed:filename.<br>
2) aStream := filename asFilename writeStream.<br>
<br>
1) this solution worked one time but when I tried to create other<br>
files with other names (whatever the name) I get an exception:<br>
FileExistsException<br>
2) doesn&#39;t work at all. I get an exception as well:<br>
MessageNotUnderstood: ByteString&gt;&gt;asFilename.<br>
</blockquote>
<br></div>
How to use FileStreams?<br>
<br>
existingReadOnlyFile := FileStream readOnlyFileNamed: &#39;foo&#39;. &quot;raises an exception if the file doesn&#39;t exist&quot;<br>
existingReadableAndWriteableFile := FileStream oldFileNamed: &#39;foo&#39;. &quot;raises an exception if the file doesn&#39;t exist&quot;<br>
readableAndWriteableFile := FileStream fileNamed: &#39;foo&#39;. &quot;automatically creates the file if it doesn&#39;t exist&quot;<br>
newReadableAndWriteableFile := FileStream newFileNamed: &#39;foo&#39;. &quot;raises an exception if the file exists&quot;<br>
newReadableAndWriteableFile := FileStream forceNewFileNamed: &#39;foo&#39;. &quot;deletes the file if it exists&quot;<br>
<br>
All of these methods have a do: variant. For example:<br>
FileStream readOnlyFileNamed: &#39;foo&#39; do: [ :file | file contents &quot;This will close the file and return it&#39;s contents.&quot; ].<br>
<br>
When to use StandardFileStream?<br>
Only when you don&#39;t need character encoding or line-end conversion.<div><br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
I don&#39;t know what to do.... I don&#39;t understand why I have the<br>
exception FileExistsException even thought the name I give to filename<br>
is different...<br>
</blockquote>
<br></div>
Are you sure that the file doesn&#39;t exist? Some systems (windows and most macs) are case insensitive, so if you have a file named &#39;TEST&#39;, then you also have &#39;test&#39; and &#39;Test&#39;, etc.<br>
<br>
<br>
Levente<br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div>
<br>
Thx for your help<br>
<br>
alex<br></div>
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
<br>
</blockquote>
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</blockquote></div></div></div><br></div>
<br>_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
<br></blockquote></div></div></div><br>
<br>_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
<br></blockquote></div></div></div><br></div>
<br>_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
<br></blockquote></div><br>