Solved

Copy Directory

Posted on 1998-09-29
2
214 Views
Last Modified: 2010-04-06
Any easy way to copy an entire directory?
0
Comment
Question by:rwv
2 Comments
 
LVL 4

Accepted Solution

by:
BoRiS earned 100 total points
ID: 1341209
rwv

try something like this...

procedure TForm1.Button1Click(Sender: TObject);
            var
              DirInfo: TSearchRec;
              r : Integer;
            begin
              r := FindFirst('C:\Download\Test\*.*', FaAnyfile, DirInfo);
              while r = 0 do  begin
                if ((DirInfo.Attr and FaDirectory <> FaDirectory) and
                    (DirInfo.Attr and FaVolumeId <> FaVolumeID)) then
                  if CopyFile(pChar('C:\Download\test\' + DirInfo.Name))
                     = false then
                   ShowMessage('Unable to find Directory : C:\Download\test\' +
                               DirInfo.Name);
                r := FindNext(DirInfo);
              end;
            end;

This is how I would it, thou I must say I have never tried to copy the whole directory but here you go, hope this helps...

Later
BoRiS
0
 

Author Comment

by:rwv
ID: 1341210
a recursive version of this will do subdirectories too
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Virtuailstring tree compare node issue 14 116
Using idhttp to login to instagram 2 89
Firemonkey android show image from resource ? 1 42
PHP preg_replace code convert to Delphi 14 55
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question