Dear Wolfgang,

Many thanks for your answer. It works fine now. I had just to include Open in the import part of the functor. I've also modified the code in File.oz and it works fine also. I didn't read yet the code of File.oz very carefully but it seems to use the url for ReadList, ReadListLazy and ReadOpen (thus for all the read operations) and the name for all the write operations (WriteList, WriteOpen, WriteAppend). I wonder why. I don't understand the code for ReadBlock and Write but it surely is because I'm not far enough in my study of Oz. Using File.oz as a model, I plan to write two others functors one using url and one using name, but maybe there is a more "generic" way to do this. I'll see.

By the way, when I run wordapp, after closing the window, I have to use "ctrl-C" to go back to the command line prompt. I suppose there is a better way to do this?

Thanks again.

Cheers

Robert

Wolfgang Meyer a écrit :
Dear Robert,

I can reproduce the problem on my machine.
There seems to be a problem with the example or with the File.ozf implementation.

There are two different ways to open a file in Oz:
{New Open.file init(url:URL)}
and
{New Open.file init(name:NAME)}

The function File.readList of the example uses the first form. But "stdin" is not a valid URL. It is a valid filename, however.

If you replace the line
L = {File.readList stdin}
with

F = {New Open.file init(name:stdin)}
L = {F read(list:$ size:all)}
{F close}

the example should work as expected.

Cheers,
 Wolfgang


Robert Godfroid wrote:
Hi,

I'm a newbie in Oz and currently working with CTM (3rd printing)
When I try to execute the standalone program wordapp.oz (pp 225-230), I've got this error message:

***error in URL support
***
*** Cannot locate file
*** File name: stdin
*** Operation: open
***
*** Call stack:
*** procedure 'get' in file "f:cygwin/home/Administrator/Mozart-1-3-2/mozart/share/lib/init/Resolve.oz", line 394, column 6, PC = 24427592
**

The only change I've made in the code shown on page 227 is the following: instead of File in the import part, I had to write File at <location of File.ozf> on my computer.

On my computer, Mozart is running on Windows Vista Edition familiale Premium

I can't figure out where the problem comes from.
Is it a problem with Vista? with cygwin? with the funcor File?

Thanks for any help

Cheers

Robert

_________________________________________________________________________________ mozart-users mailing list [email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users


_________________________________________________________________________________ mozart-users mailing list [email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to