Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CopyFileTo comes up as Undeclared Identifier

Status
Not open for further replies.

mghafoori

Programmer
Feb 7, 2002
16
0
0
US
Hello:
I am trying to use CopyFileTo to copy a file from one location to another in Delphi 6. When compiling my code, it comes up as undecalred identifier. Do I need to set any paths, or files. any help is appreciated. Also, is there a MoveFile function in Delphi or do i have to use copy and delete?
 
Do you have IDGlobal in your uses section?


Leslie
landrews@metrocourt.state.nm.us

There are 10 types of people in the world -
those who understand binary
and
those who don't!
 
CopyFile and MoveFile are in the FmxUtils unit.

In Delphi 5 and Delphi 7 this is in the demos\doc\filmanex subdirectory of your Dephi installation directory.

So you need Uses FmxUtils in your application. You may have to modify your search path to include filmanex.

Andrew
 
Andrew,
I have Delphi 6 and when I type CopyFileTo and F1, it comes up with:

CopyFileTo
Unit: IdGlobal

Copies the source file to the destination file.


function CopyFileTo(const Source: string; const Destination: string): Boolean;

Parameters

const Source: string

Source file name.


const Destination: string

Destination file name.


Returns

Boolean - True if the file is copied, False on error.


Description

CopyFileTo is a function used to copy the file specified in Source to the file specified in Destination.
CopyFileTo will return False if the file in Destination already exists.
CopyFileTo encapsulates the platform-specific calls needed to perform the file copy operation. On the Windows platform, this is the Win32 API function CopyFile. On the Linux platform, CopyFileTo uses a TFileStream instance to create the destination file.

Leslie

 
Thanks Leslie, I'd not heard of CopyFileTo before.

I upgraded from D5 to D7.

There must be hundreds of functions/procedures out there which I don't know about but would be useful to me. <sigh>

Andrew
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top