sam-fans - fans of the sam editor
 help / color / mirror / Atom feed
* (no subject)
@ 1993-04-13  0:16 Michael John Haertel
  1993-04-13  0:36 ` sam as a synchronous thing John Mackin
  0 siblings, 1 reply; 2+ messages in thread
From: Michael John Haertel @ 1993-04-13  0:16 UTC (permalink / raw)
  To: sam-fans

rsalz wrote:

>How do I
>tell the "editor" that I'm done editing?

This is the best solution I've come up with.

#! /bin/sh
B $1
waitforchanges $1

where "waitforchanges" is the following small C program:

#include <sys/types.h>
#include <sys/stat.h>

main(int argc, char *argv[])
{
	struct stat ost, nst;

	if (argc != 2)
		exit(1);
	if (stat(argv[1], &ost) < 0)
		exit(1);
	for (;;) {
		sleep(3);
		if (stat(argv[1], &nst) < 0)
			exit(1);
		if (nst.st_mtime != ost.st_mtime)
			break;
	}
	exit(0);
}


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1993-04-13  0:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-04-13  0:16 Michael John Haertel
1993-04-13  0:36 ` sam as a synchronous thing John Mackin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).