 |
 |
 |
|
|  |  |
 |
CopyFile ..msdn Add comment W32 Constants Translate this page |
 |
 |
|
This function copies an existing file to a new file |
 |  | | Code examples: |  | |
|
 |  | | Declaration: |  |  |
BOOL CopyFile(
LPCTSTR lpExistingFileName,
LPCTSTR lpNewFileName,
BOOL bFailIfExists );
|
 |  |  | | FoxPro declaration: |  |  |
DECLARE INTEGER CopyFile IN kernel32;
STRING lpExistingFileName,;
STRING lpNewFileName,;
INTEGER bFailIfExists
|
 |  |  | | Parameters: |  | lpExistingFileName
[in] Long pointer to a null-terminated string that specifies the name of an existing file.
lpNewFileName
[in] Long pointer to a null-terminated string that specifies the name of the new file.
bFailIfExists
[in] Boolean that specifies how this operation is to proceed if a file of the same name as that specified by lpNewFileName already exists. If this parameter is TRUE and the new file already exists, the function fails. If this parameter is FALSE and the new file already exists, the function overwrites the existing file and succeeds |
 |  | | Return value: |  | | Nonzero indicates success. Zero indicates failure |
 |  | | Usage: |  |
? CopyFile("C:\Autoexec.bat", "C:\Autoexec.cpy", 0)
|
 |  | | My comment: |  | The native COPY FILE command cannot copy a file that is open (3. File is in use).
With the CopyFile, both the source and the destination can stay open -- like text files modified, DBF files in use and so on -- and still the copying occurs. Of course, any uncommitted changes do not appear in the target file.
To copy files with a progress dialog box use the SHFileOperation function.
See also: CopyFileTransacted |
 |  | | Word Index links for the CopyFile : |  | |
|
 |  | | Translate this page: |  | |  |  | | • |  | | Created: | 2001-07-12 12:00:00 | | Modified: | 2010-05-24 11:59:24 | Visited in last 7 days: 208 |
 |
 |
User Contributed Notes: |
 |
 |
 |
 |
 |
 | Catjoke | 2001-10-01 09:33:30 |  |
 |
 |
 | CopyFile is a perfect function.
You can redirect a remote barcode printer in Novell network by using CopyFile. (Even you don"t need install the Printer driver!!) For example, if you write a text file according to barcode printer gride, such as heat control, label tab space etc.
CopyFile(abc.txt, [\\UserB\Datamax])
Note: The UserB PC cannot use CopyFile API to call itself Printer nor call LPT1, I donno why but observe it in real test. |  |
 |
 |
 |
 |
 |
|
 |
 |
 |
 |
Copyright © 2001-2013
News2News, Inc.
Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use.
The information on this page is presented AS IS, meaning that you may use it at your own risk.
Microsoft Visual FoxPro
and Windows are trade marks
of Microsoft Corp.
All other trademarks are the property of their respective owners.
Privacy policy
|
 |
 |
 |
Credits: PHP (4.4.9), an HTML-embedded scripting language,
MySQL (5.1.55-log), the Open Source standard SQL database,
AceHTML Freeware
Version 4, freeware HTML Editor of choice. Hosted by Korax Online Inc. |
 |
 |
|
 |
 |
|
|