Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2008 Feb : How can I copy a folder ?
| Subject: | How can I copy a folder ? |
| Posted by: | "dimitris" (dimitrs_k42remove@yahoo.com) |
| Date: | Tue, 12 Feb 2008 14:51:13 |
I want to write a function that can cope an existing folder to a new place
with a new name. My code is this:
function CopyFolder(const src,dest : string ):integer;
var
Info: TSHFileOpStruct;
begin
with Info do begin
Wnd := 0;
wFunc := FO_COPY;
pFrom := pChar(Src);
pTo := pChar(dest);
fFlags := 0;
end;
try
result:= SHFileOperation(Info);
except
end;
end;
However, when I execute the code above, I am prompted with a dialog
"The destination cannot support long file names"
And it asks for a shorter file name.
What am I doing wrong?
Is there any other way around, for copying folders?