if not fileexists(path+'result.tmp') then
 begin
   filecreate('result.tmp');
   assignfile(tmp,'result.tmp');
   rewrite(tmp);--执行到这句时,报I/O32错误,请问怎么解决???

解决方案 »

  1.   

    我也遇到了这样的问题,花了一段时间才调试正确,希望对你有帮助
    if not fileexists(path+'result.tmp') then
      begin
        FileClose(filecreate('result.tmp'));///////////////
        assignfile(tmp,'result.tmp');
        rewrite(tmp);
      end;
      

  2.   

    是的,我也是,后来察看帮助,才知道用Rewrite就不会出现这个问题了,可惜晚了楼上一步,相互交流!谢谢
      

  3.   

    既然是相互交流、俺的一般写法是:if (not FileExists(FileName)) then exit;                                      //
    Assignfile(MyFile,FileName);
    Reset(MyFile);
    ...
    CloseFile(MyFile); 没有用到"FileCreate",若文件不存在、就会自動建立呀!