Solved

Copy Directory

Posted on 1998-09-29
2
211 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
Comment Utility
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
Comment Utility
a recursive version of this will do subdirectories too
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now