一函数1: 判断指定目录是否存在!!!
     
  函数2: copy 文件的函数是什么????
   
 ( 不许告诉我用winexec,shell 想求delphi 自带的或则api也可))谢谢
 即刻给分!!!!!!

解决方案 »

  1.   

    函数一
    //---------------add--2002-03-10---sunfx
    {
     function searchfolder
     搜索文件夹是否存在
    }
    function  Tyeargzreportfrm.searchfolder(var foldername:string):boolean;
    var
      path:string;
      sr: TSearchRec;
    begin
    path:=ExtractFilePath(Application.ExeName)+'report\'+foldername;
      if FindFirst(path, faAnyFile, sr) = 0 then
        begin
        if ((sr.Attr and fadirectory) = fadirectory) and (sr.Name<>'.') and (sr.Name<>'..') then
         begin
           result:=true;
         end;
         end //first
         else
              result:=false;
        FindClose(SR);
    end;
      

  2.   

    try
    {
       if(fileOut.Open(以独享方式打开))
       {
      //操作文件
       };
    }拷贝文件CopyFile
      

  3.   

    if directoryexist('c:\123') then showmessage('ok')
    if copyfile('c:\123.dbf','c:\456.dbf',false) then showmessage('ok')
      

  4.   

    第二个函数:
    使用 sysutil.copy ();
    判断 文件夹也就是目录是否存在 :应该是有个专门的函数,就象fileexists 一样具体你自己找找!~~~
      

  5.   

    if not directoryexists(bfdatapath) then
           ForceDirectories(bfdatapath);判断文件夹(目录)是否存在!不存在创建!if not fileexists(bfdatapath + newdatafile) then
           CopyFile(PChar(extractfilepath(application.exename) + filename),
                   PChar(bfdatapath + newfilename),
                   true );判断文件newdatafile是否存在!不存在则将extractfilepath(application.exename)目录下的文件filename复制到bfdatapath目录下,以newfilename命名!!