VC + + CopyFile, MoveFile function usage __jquery

Source: Internet
Author: User
BOOL CopyFile (
LPCTSTR lpexistingfilename,//pointer to name of a existing file
LPCTSTR lpnewfilename,//pointer to filename to copy to
BOOL bfailifexists//Flag for operation if file exists
);
The meaning of each of these parameters:
LPCTSTR Lpexistingfilename,//You want to copy the source file name
LPCTSTR Lpnewfilename,//You want to copy the target file name
BOOL bfailifexists///If Target already exists, does not copy (True) and returns false, overriding Target (false)

CopyFile
Copy files A through B, and if b already exists, overwrite
CopyFile (A, B, FALSE);
	BOOL bcopy = false;
	bcopy = CopyFile ("D:\\dtest16\\annet1"). DCM_0001.DCM "," D:\\DTEST16\\FILETEST\\001.DCM ", FALSE); 
	cout<<bcopy<<endl;

MoveFile//Move A to B MoveFile (a,b);
MoveFile ("D:\\DTEST16\\FILETEST\\MYFILE\\001.DCM", "D:\\DTEST16\\FILETEST\\MYFILE\\001\\001.DCM");
Expansion 1. The following encapsulates 4 functions _copyfile,_deletefile,_movefile,_renamefile
2. Each function copies the original path, ensuring that the path ends with 2 \0\0. (If you don't end with 2 \0\0, you tend to get an error)
3. Applies to files or folders

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.