winexec(pchar('cmd.exe /c netstat -n>netstat.txt'),sw_hide);
这样生成一文件netstat.txt, 我的程序在生成此文件3秒后读它, 但有时这文件还没写入磁盘, 出现打不开此文件的错误.
如何能判断此文件写入磁盘后再打开它呢?
这样生成一文件netstat.txt, 我的程序在生成此文件3秒后读它, 但有时这文件还没写入磁盘, 出现打不开此文件的错误.
如何能判断此文件写入磁盘后再打开它呢?
if FileExists('netstat.txt') then
ShellExecute(0, nil, PChar('netstat.txt'), nil, nil, SW_NORMAL);
ShellExecute(0, nil, PChar('netstat.txt'), nil, nil, SW_NORMAL);
是什么功能? 能避免文件写入一半被读出吗?