2011-09-04 10 views
0

Synopse Big Table을 사용하여 전체 폴더를 파일 및 폴더와 함께 저장하려면 어떻게해야합니까? 압축하지 않고 파일을 백업해야합니다. Synopse Big Table이 이러한 목적에 적합하다고 들었습니다. 하지만 그 정보를 찾을 수 없습니다.Delphi : Synopse Big Table을 사용하여 파일이있는 폴더 저장

감사합니다.

+0

압축하지 않는 이유. –

답변

1

왜이 질문을 작성하지 않으셨습니까? in the library forum?

function SaveFolderToBigTableFile(const aFolder, aFile: TFileName): boolean; 
var SR: TSearchRec; 
    BT: TSynBigTableString; 
    aPath: TFileName; 
    Path: RawUTF8; 
begin 
    DeleteFile(aFile); 
    result := true; 
    BT := TSynBigTableString.Create(aFile); 
    try 
    aPath := ExtractFilePath(aFolder); 
    Path := StringToUTF8(aPath); 
    if FindFirst(aPath+'*.*',faAnyFile,SR)=0 then 
    try 
     repeat 
     if (SR.Name[1]='.') or (faDirectory and SR.Attr<>0) then 
      Continue; 
     if BT.Add(StringFromFile(aPath+SR.Name),StringToUTF8(SR.Name))<>0 then 
      writeln(SR.Name,' added') else begin 
      result := false; 
      writeln(SR.Name,' ERROR'); 
     end; 
     if BT.CurrentInMemoryDataSize>100000000 then 
      BT.UpdateToFile; 
     until FindNext(SR)<>0; 
    finally 
     FindClose(SR); 
    end; 
    finally 
    BT.Free; 
    end; 
end; 

트릭 키와 파일 이름을 사용하여 TSynBigTableString 클래스를 사용하는 것입니다

OK, 여기에 몇 가지 예제 코드입니다.

SynLZ 라이브러리를 사용하여 매우 빠른 압축을 추가 할 수 있습니다 (압축률은 훨씬 빠르지 만 압축률은 조금 떨어짐).