hh@tut.fi (Halme Heikki) (06/03/89)
In article <8087@batcomputer.tn.cornell.edu> prove@batcomputer.tn.cornell.edu (Roger Ove) writes:
It should be possible ...
... to check on the file's existence, and on failure download
the rest of the ps. I tried to implement this and failed,
seemingly due to a NeWS bug. Putting the file load in a
{...open file ...} stopped
clause ought to do the trick, but it bombs out anyway when it
can't find the file. I guess I'm not the only one that has
run into this problem, since the routine /fileexists in the
default init.ps is commented out. Has anyone found a way to
make this work?
The routine /fileexists in init.ps does work, just try it! So, what
else is there that is commented out and works just fine?
Heikki Halme
Tampere Univ. of Technology, Finland
hh@tut.fi
prove@batcomputer.tn.cornell.edu (Roger Ove) (06/07/89)
In article <HH.89Jun3122644@hemppo.tut.fi>, hh@tut.fi (Halme Heikki) writes: > > The routine /fileexists in init.ps does work, just try it! So, what > else is there that is commented out and works just fine? > I tried this and it fails when the file doesn't exist, it bombs with the error "undefinedfilename" and terminates the process. Works fine if the file is there, hardly a satisfactory substitute. It seems that I would have to do my own error handling to make this work. No doubt you checked both cases before writing this, perhaps the bug has been fixed in the new release? I tested it on NeWS 1.1. That might explain why it was commented out even though it worked for you. Roger Ove
ks@karikukko.tut.fi (Syst{ Kari) (06/07/89)
In article <8130@batcomputer.tn.cornell.edu> prove@batcomputer.tn.cornell.edu (Roger Ove) writes: > I tried this and it fails when the file doesn't exist, it bombs >with the error "undefinedfilename" and terminates the process. Works >fine if the file is there, hardly a satisfactory substitute. It Well, I tried Heikki's idea and it worked just fine ! This is the pretty-printed version of the excluded fileexists: /fileexists { {(r) file} stopped { pop pop false } { closefile true } ifelse } def PS. We are running NeWS 1.1. Kari Systa ks@tut.fi (ks@tut.UUCP, ..!mcvax!tut!ks, ks@fintut.bitnet) Tampere Univ. Technology Telefax: Phone Software System Laboratory +358 31 162913 work: +358 31 162585 Po. Box. 527, SF-33101 Tampere, Finland home: +358 31 177412
prove@batcomputer.tn.cornell.edu (Roger Ove) (06/07/89)
It could be that I have a premature (buggy) release of NeWS 1.1, since otherwise I can't see why this works for you and not me. Here is a session log, using the routine cut from your posting (same result for the init.ps version as well, of course): psh executive (NeWS/debug.ps) run dbgstart Welcome to NeWS Version 1.1 Debugger installed. /fileexists { {(r) file} stopped { pop pop false } { closefile true } ifelse } def (user.ps) fileexists pstack true clear (nofile) fileexists **ERROR** The error & current stack are: Error name: undefinedfilename Command:'file' (r) (nofile) **ERROR** The error & current stack are: Error name: typecheck Command:`closefile' (r) (nofile) pstack (nofile) (r) true
spock@ihlpf.ATT.COM (Weiss) (06/08/89)
In article <8130@batcomputer.tn.cornell.edu> prove@batcomputer.tn.cornell.edu (Roger Ove) writes: >In article <HH.89Jun3122644@hemppo.tut.fi>, hh@tut.fi (Halme Heikki) writes: >> The routine /fileexists in init.ps does work, just try it! So, what >> else is there that is commented out and works just fine? > I tried this and it fails when the file doesn't exist, it bombs >with the error "undefinedfilename" and terminates the process. Works Are you running the debugger when you use /fileexits? If so, you need to changed the stopped to errored. The reason you need to do this is that the debugger causes stopped not to work the way you think it should. errored will work the same as stopped even if the debugger is not running. Why all the stopped's were not changed to errored, I will never know. -- Ed Weiss "I thought it was generally accepted, sir, that att!ihlpf!spock vulcans are an advanced and most honorable race." "They are, they are. And damn annoying at times."