if not DirectoryExists('c:/gm/get') then
begin
CreateDir('c:/gm/get');
end;
if not FileExists('c:/gm/get/mz.txt') then
begin
//CreateFile(PChar('c:/gm/get/mz.txt'));
Rewrite
end;
AssignFile(txtFile,'c:/gm/get/mz.txt');
Rewrite(txtFile);
if not DirectoryExists('C:/123') then
ForceDirectories('C:/123'); <<-- 强制创建目录,不会因上级目录不存在而不创建
tmpFileStream := TFileStream.Create('c:/123/1.txt', fmCreate or fmOpenReadWrite);