看板 Linux 關於我們 聯絡資訊
請問 我run了一個程式,會在console output 一些data。 我想把data output 到 .log 所以下了 ./program XXX > xxx.log 但是這個程式 run到一半會掛掉。 所以連未掛掉之前的data 也都沒有辦法寫到.log 檔案。 請問 有解決辦法嗎? thanks -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.113.166.28
Adama:C/C++有flush()可用 06/09 13:10
leveler:sync might help 06/09 17:15
jlovet:./program XXX 1>&2 2>log stderr應該會每個char都寫入 06/09 23:49