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><meta charset="utf-8"><meta charset="utf-8"><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; 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>

<div>alex</div><meta charset="utf-8"><div><br><br><div class="gmail_quote">2010/11/28 Levente Uzonyi <span dir="ltr">&lt;<a href="mailto:leves@elte.hu">leves@elte.hu</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">On Sat, 27 Nov 2010, alexandre bp wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;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 class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<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><br></div>