Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2006 Apr : Problem using SHFileOperation with big size directory

www.cryer.info
Managed Newsgroup Archive

Problem using SHFileOperation with big size directory

Subject:Problem using SHFileOperation with big size directory
Posted by:"Steve Légaré" (steve.lega..@cha.quebec.qc.ca)
Date:Tue, 11 Apr 2006 10:07:58 -0400

I used Delphi 7 with Api function SHFileOperation.
This is my function :

function CopyDir(const fromDir, toDir: string): Boolean;
var
   fos: TSHFileOpStruct;
begin
   ZeroMemory(@fos, SizeOf(fos));
   with fos do
   begin
     wFunc  := FO_COPY;
     fFlags := FOF_FILESONLY;
     pFrom  := PChar(fromDir + #0);
     pTo    := PChar(toDir)
   end;
   Result := (0 = ShFileOperation(fos));
end;

My directory structure contains 3347 directories with 21 376 files.  The
size of the root directory is 3.6 GB.

If I run CopyDir('\docs\intranet\drf\rapgestion\aa', 'c:\temp')
everything is OK.  But if I run this code (with the root directory)
CopyDir('\docs\intranet\drf\rapgestion\', 'c:\temp') it gaves me a
errorcode 6.  What is the differences between those two lines of code
except the size of my directory structure (Dir AA contains 99 files, 36
directories, size 12.3 MB) ?

I hope someone can help me.

Thanks

Info

Glossary

Replies:

www.cryer.info
Managed Newsgroup Archive