0

服务器在执行网页时写入动态文件。并在执行结束时清理文件。

正常情况:

  I. Load page
 II. cgi calls bash script to do some backend stuff (takes a few 
     seconds, creates some tmp files)
III. bash script returns, and cgi removes the files at the end of execution

异常情况:

  I. Load page
 II. cgi calls bash script to do some backend stuff (takes a few 
     seconds, creates some tmp files)
III. user clicks stop on browser, and the perl script terminates
 IV. tmp files left on server :(

我确信有一种方法可以检测来自浏览器的信号(因此处理异常),但由于我是 Web 开发新手,我不知道要搜索什么......

4

0 回答 0