FileStream

Dan Ingalls DanI at wdi.disney.com
Mon Feb 1 18:56:01 UTC 1999


>if i try to open a FileStream on a file that is not in the local directory,
>the open fails. i.e.
>
>    FileStream fileNamed: 'email\mbox1.txt'
>
>returns nil. (the folder émail' exists; 'mbox1.txt' does not and i want it
>to be created). if this is appropriate behaviour, what do i need to do to
>open a FileStream on a file that is not in the local directory? what about
>the case where neither the path nor the file exists and i want to create both?

David -

I tried, 

	(FileStream fileNamed: 'zort') nextPutAll: 'Hello.'; close.

and it worked fine to create a new file in my local directory.  The I tried,

	(FileStream fileNamed: 'HD:Fun with 2.1:zort') nextPutAll: 'Hello.'; close.

and it worked fine to create a new file in a directory that was not my local directory.  This was all on a mac.

Is it possible that you have the path wrong, or that you are expecting implicit creation of directories (if, eg, 'email' did not exist), which Squeak does not do?

	- Dan





More information about the Squeak-dev mailing list