Tim Gruene wrote:
Hello,
I'm looking for a script that automatically loads a PDB file when it has
changed on disk in order to display the changes with a previous version
of that file.
How about this:
----
(define *updating-file-name* "xxx.pdb")
(let ((stat-updated-file 0))
(gtk-timeout-add
200
(lambda ()
(if (file-exists? *updating-file-name*)
(let ((new-mtime (stat:mtime (stat *updating-file-name*))))
(if (> new-mtime stat-updated-file)
(begin
(set! stat-updated-file new-mtime)
(handle-read-draw-molecule-with-recentre *updating-file-name*
0)))))
#t)))
----
This loads a new version of xxx.pdb every time - I'm guessing that that
is what you want (rather than the xxx.pdb molecule begin replaced).
Paul.