}
+string multipr::getFilenameWithoutPath(const char* pFilename)
+{
+ char* res = strrchr(pFilename, '/');
+ if (res == NULL)
+ {
+ return pFilename;
+ }
+ else
+ {
+ char* name = res + 1;
+ return name;
+ }
+}
+
+
+string multipr::getPath(const char* pFilename)
+{
+ char* res = strrchr(pFilename, '/');
+ if (res == NULL)
+ {
+ return "";
+ }
+ else
+ {
+ int size = res - pFilename + 1;
+ char path[256];
+ memcpy(path, pFilename, size);
+ path[size] = '\0';
+ return path;
+ }
+}
+
+
+void multipr::copyFile(const char* pFilename, const char* pDestDir)
+{
+ const char* srcDir = multipr::getPath(pFilename).c_str();
+ if (strcmp(srcDir, pDestDir) == 0) return;
+
+ const char* filenameWithoutPath = multipr::getFilenameWithoutPath(pFilename).c_str();
+ char pDstFilename[256];
+ sprintf(pDstFilename, "%s%s", pDestDir, filenameWithoutPath);
+
+ FILE* src = fopen(pFilename, "rb");
+ if (src == NULL) return;
+ FILE* dst = fopen(pDstFilename, "wb");
+ if (dst == NULL) return;
+
+ const int size = 65536;
+ char* buf = new char[size];
+ int ret;
+ ret = fread(buf, 1, size, src);
+ while (ret != 0)
+ {
+ fwrite(buf, 1, ret, dst);
+ ret = fread(buf, 1, size, src);
+ }
+
+ delete[] buf;
+ fclose(src);
+ fclose(dst);
+}
+
+
void multipr::printArray2D(
const med_float* pData,
const int pNumElt,