void
CopyDirectory( AnsiString Dest, AnsiString Source )
// Dest & Source must be end with '//' and Exist!
{
TSearchRec TSR;
if ( ! FindFirst( Source + " *.* " , faAnyFile, TSR ) )
{
do
{
if ( TSR.Attr & faDirectory )
{
if ( TSR.Name != " . " && TSR.Name != " .. " )
{
CreateDir( Dest + TSR.Name + " / " );
CopyDirectory( Dest + TSR.Name + " / " , Source + TSR.Name + " / " );
}
}
else
CopyFile( (Source + TSR.Name).c_str(), (Dest + TSR.Name).c_str(), false );
}
while ( ! FindNext( TSR ) );
FindClose( TSR );
}
}
// Dest & Source must be end with '//' and Exist!
{
TSearchRec TSR;
if ( ! FindFirst( Source + " *.* " , faAnyFile, TSR ) )
{
do
{
if ( TSR.Attr & faDirectory )
{
if ( TSR.Name != " . " && TSR.Name != " .. " )
{
CreateDir( Dest + TSR.Name + " / " );
CopyDirectory( Dest + TSR.Name + " / " , Source + TSR.Name + " / " );
}
}
else
CopyFile( (Source + TSR.Name).c_str(), (Dest + TSR.Name).c_str(), false );
}
while ( ! FindNext( TSR ) );
FindClose( TSR );
}
}