| 961 | */ |
| 962 | |
| 963 | int VSICopyFile(const char *pszSource, const char *pszTarget, |
| 964 | VSILFILE *fpSource, vsi_l_offset nSourceSize, |
| 965 | const char *const *papszOptions, GDALProgressFunc pProgressFunc, |
| 966 | void *pProgressData) |
| 967 | |
| 968 | { |
| 969 | if (!pszSource && !fpSource) |
| 970 | { |
| 971 | CPLError(CE_Failure, CPLE_AppDefined, |
| 972 | "pszSource == nullptr && fpSource == nullptr"); |
| 973 | return -1; |
| 974 | } |
| 975 | if (!pszTarget || pszTarget[0] == '\0') |
| 976 | { |
| 977 | return -1; |
| 978 | } |
| 979 | |
| 980 | VSIFilesystemHandler *poFSHandlerTarget = |
| 981 | VSIFileManager::GetHandler(pszTarget); |
| 982 | return poFSHandlerTarget->CopyFile(pszSource, pszTarget, fpSource, |
| 983 | nSourceSize, papszOptions, pProgressFunc, |
| 984 | pProgressData); |
| 985 | } |
| 986 | |
| 987 | /************************************************************************/ |
| 988 | /* VSICopyFileRestartable() */ |
no test coverage detected