Path: utzoo!attcan!uunet!anise.acc.com!ucbvax!hoptoad!gnu From: gnu@hoptoad.uucp (John Gilmore) Newsgroups: comp.windows.news Subject: NeWS applications should not depend on file access on the server Message-ID: <7506@hoptoad.uucp> Date: 2 Jun 89 01:12:43 GMT Organization: Grasshopper Group in San Francisco Lines: 44 I have seen a number of applications, from Sun's supplied psterm and scrolldemo, to GoodNeWS, which load in files on the machine running the NeWS server, regardless of where the client program was run from. This causes a variety of problems. The most obvious is that such a program doesn't work unless it is installed on both the server and the client. If you go to someone else's NeWS screen and run the client, it dies. If you try to demo it to a colleague while visiting some other University, it dies. If you reinstall the NeWS server directories, it dies. Etc. Another problem is that users will specify file names to this kind of command, expecting the files to be referenced with regard to the current directory and host machine on which they are running the command. Instead the files are relative to the directory that NeWS was started in on the server machine. I had this bite me when I modified "scrolldemo" to be able to show any file, not just those compiled in to it. It also makes these applications fail to run on "NeWS terminals" (I like the term "newts", which someone proposed here on News-makers.) Hugh Daniel pointed out this problem more than a year ago when he was working on the now-dead MacOS NeWS port for Wedge, which didn't have a Unix file system behind it. The solution is fairly obvious -- EVERYTHING required by the PostScript side of an application must be uploaded from the client side over the network socket. All the PostScript code. All the image files. All the custom fonts. All the everything. It's not hard -- at Grasshopper we spent more time arguing over it, than we did implementing it in psterm. And there is no evidence that it's slower than reading from the server's file system -- though even if it was, you can't start optimizing until you first make it work! And it doesn't work if you have to customize the server. I recommend that the words used for local file access (forkunix, readcanvas, file, loadfile, writescreen, etc) be moved out of systemdict and into a private dictionary. Dummy versions that will only operate on sockets or %stdin or %stdout or %stderr could be put in systemdict to catch thse poor practices and diagnose them. PostScript code such as init.ps that really needs to do this, can run the words from the private dict. -- John Gilmore {sun,pacbell,uunet,pyramid,amdahl}!hoptoad!gnu gnu@toad.com A well-regulated militia, being necessary to the security of a free State, the right of the people to keep and bear arms, shall not be infringed.