Hi, On Wed, Sep 8, 2010 at 7:38 PM, Khadija EL MAHRSI <[email protected]> wrote: ... > If it's not much to ask I have yet another question. Let's say I want to use > Open and not OS so this class can write something in a file whose path, for > example, is the following "C:\Cygwin\home\file1.txt". Since I'm working on > localhost as the remote site on which the instance is running, this path > works just fine by putting it as "name:" but if I were to change localhost > into some other machine, what are the changes I need to make in order to > have the same result?
It depends on where exactly the code is running and where the file should be created. The "Open" module is mostly object-oriented, I believe. If you create a _stationary_ Open.file object that runs on the same machine A where "file1.txt" should be, you don't have to adjust anything. If the Open.file instance is created on another machine B though, then you cannot open a file on A. As a general guideline: Oz' relatively transparent distribution support can make it easy to get confused about the program architecture. Generally, it is a good idea to plan the distributed architecture of a program before implementation, just as you would do with a more explicit distribution layer like CORBA or Java RMI. You could for example implement a central server that offers services like random numbers or file writing to class instances running on other machines. The good thing is that such a server is relatively easy to implement in Oz. > I'm thinking of changing the "name:" into "url:" but I have to admit that You can only use this if you have a web server or a file server running on the machine where you want to read a file. And it can only be used for reading, NOT writing. Cheers, Wolfgang _________________________________________________________________________________ mozart-users mailing list [email protected] http://www.mozart-oz.org/mailman/listinfo/mozart-users
