fredop
asked on
CopyFile in VC++
Hi,
Could someone tell please tell me if there is any way of using CopyFile (or is there a similar funciton) that I can use to copy files with "*.ini" (*.*, etc)?
i.e.
copyfile("c:\\temp\\*.ini" ,"d:\\dest ");
or, will I have to write a function to do this?
Thanks.
Could someone tell please tell me if there is any way of using CopyFile (or is there a similar funciton) that I can use to copy files with "*.ini" (*.*, etc)?
i.e.
copyfile("c:\\temp\\*.ini"
or, will I have to write a function to do this?
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks,
That's what I'll do.
That's what I'll do.
Written quickly I'd do something like this:
HANDLE hFile;
WIN32_FILE_DATA data;
BOOL bContinue = TRUE;
hFile = FindFirstFile("*.ini", &data);
if( hFile != INVALID_HANDLE_VALUE )
bContinue = FALSE;
while(bContinue) {
CopyFile(data.cFileName, "c:\temp\");
bContinue = FindNextFile(hFile, &data);
}
HANDLE hFile;
WIN32_FILE_DATA data;
BOOL bContinue = TRUE;
hFile = FindFirstFile("*.ini", &data);
if( hFile != INVALID_HANDLE_VALUE )
bContinue = FALSE;
while(bContinue) {
CopyFile(data.cFileName, "c:\temp\");
bContinue = FindNextFile(hFile, &data);
}
HANDLE hFile;
WIN32_FILE_DATA data;
BOOL bContinue = TRUE;
hFile = FindFirstFile("*.ini", &data);
if( hFile != INVALID_HANDLE_VALUE )
bContinue = FALSE;
while(bContinue) {
CopyFile(data.cFileName, "c:\temp\");
bContinue = FindNextFile(hFile, &data);
}