Re: [問題] 如何持續讀取文字檔內容

作者: freaky (jon)   2016-03-12 13:39:17
首先要知道 A程式以何種設定開檔,再根據以下的表格決定你開檔的設定
及先後順序(允許的情況下):
Create and Opening Files
https://goo.gl/WfDPmb
FindFirstChangeNotification()/FindNextChangeNotification()
可得知檔案寫入變化,有變化時再讀取log。
Obtaining Directory Change Notifications
https://goo.gl/kApBZq
※ 引述《Metals (甜在心饅頭)》之銘言:
: 開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
: vc++
: 假設有一支A程式一直把執行結果的log輸出至txt檔,但不知道什麼結束,我想寫個程式
: 去抓取此txt檔,分析某項數值,但程式在開檔時會佔用此txt,造成A程式無法再寫入txt
: 請問在無法改變A程式情況下,我要怎麼設計可即時擷取txt內容,又不影響A程式?
作者: Metals (甜在心饅頭)   2016-03-13 09:41:00
請問若是batch檔用">"輸出至txt,可用以上方式判定嗎?

Links booklink

Contact Us: admin [ a t ] ucptt.com