On 13-Mar-08 08:45:32, Robert Thorsby wrote: > I've finally started one of those rainy day projects. I'm rewriting my > Business Letterhead shell script. > > It's progressed to the stage where, after I've written the draft > letter, the script opens the input file in the text editor du jour and > also opens the resulting postscript file in gv. Every time I hit "Save" > in the text editor the script automagically re-runs the input file > through groff and, of course, the "watch" switch in gv automagically > reloads the updated postscript file. The result is a sort of groff > version of WYSIWYG. > > However, I don't know what would happen if I used the text editor > "Save" twice in quick succession. In other words what would happen if > my text editor is amending the input file on the "second" occasion at > the same time as groff is processing it as a result of the "first" > save? > > Can anyone tell me what is likely to happen? I have no idea how to > create the problem deliberately. > > TIA, > Robert Thorsby
I run exactly the same kind of script. I very much doubt if it matters. Groff will take the file as it finds it, and for most input files will read it in very quickly -- you would have to move pretty fast to re-save a changed file before groff finishes reading the first version. However, even if the file changes while groff is still reading it, I think the worst that would happen is that you end up with an output file (PS) which was invalid. Then gv would give you a warning message to that effect. If that happened, all you would need to do is hit "Save" again. Groff would re-read the file, re-make the PS output, and gv would re-read that since it is in "watch" mode. So you would be back on the rails. Hoping that helps! Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <[EMAIL PROTECTED]> Fax-to-email: +44 (0)870 094 0861 Date: 13-Mar-08 Time: 09:43:39 ------------------------------ XFMail ------------------------------