Re: [問題] cgi如何以背景執行一個外部程式
man 2 fork
* The child inherits copies of the parent's set of open file descrip-
tors. Each file descriptor in the child refers to the same open
file description (see open(2)) as the corresponding file descriptor
in the parent. This means that the two descriptors share open file
status flags, current file offset, and signal-driven I/O attributes
(see the description of F_SETOWN and F_SETSIG in fcntl(2)).
我想應該是因為這個關係吧
因為在你的Perl執行system之前有打開了檔案 (就是輸出到你網頁上的...)
這個file handle 被system執行的東西繼承了...
所以...在你child 結束之前,這檔案都是保持打開狀態
恩...就這樣
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.123.235.194
推
06/23 06:28, , 1F
06/23 06:28, 1F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 2 之 3 篇):
Perl 近期熱門文章
PTT數位生活區 即時熱門文章