Копирование найденых файлов Delphi

Discussion in 'С/С++, C#, Rust, Swift, Go, Java, Perl, Ruby' started by Leon2009, 11 Jan 2010.

  1. Leon2009

    Leon2009 New Member

    Joined:
    1 Sep 2009
    Messages:
    44
    Likes Received:
    0
    Reputations:
    0
    Здравствуйте! может кто помочь? надо скопировать все найденные файлы. а как это сделать незнаю.
    Code:
    procedure GetAllFiles(mask: string);
    var
      search: TSearchRec;
      directory: string;
    begin
      directory := ExtractFilePath(mask);
      if FindFirst(mask, $23, search) = 0 then
      begin
         repeat
            Form1.ListBox1.Items.Add(directory + search.Name);
           [COLOR=DarkOrange] copyfile(directory + search.Name, 'c:\1\'+directory + search.Name);[/COLOR]
            Inc(Count);
         until FindNext(search) <> 0;
      end;
      if FindFirst(directory + '*.*', faDirectory, search) = 0 then
      begin
         repeat
            if ((search.Attr and faDirectory) = faDirectory) and (search.Name[1] <> '.') then
               GetAllFiles(directory + search.Name + '\' + ExtractFileName(mask));
         until FindNext(search) <> 0;
         FindClose(search);
      end;
    end;
    
    Спасибо!
     
Loading...