/* wosFunctPP.cpp - C wrapper WOS functions */ #include #include // JMC #include #include #include #include #include #include #include #include "wosFunctPP.hpp" int main(int argc, char** argv) { int status; char wosOidStr[MAX_NAME_LEN]; char *tmpStr; *wosOidStr = '\0'; tmpStr = malloc (MAX_NAME_LEN); snprintf (tmpStr, MAX_NAME_LEN, "%s=%s", WOS_HOST_ENV, WOS_HOST); putenv (tmpStr); tmpStr = malloc (MAX_NAME_LEN); snprintf (tmpStr, MAX_NAME_LEN, "%s=%s", WOS_POLICY_ENV, WOS_POLICY); putenv (tmpStr); status = wosSyncToArchPP (DEF_FILE_CREATE_MODE, 0, wosOidStr, (char *) SRC_FILE_NAME, -1); if (status >= 0) { rodsLong_t fileSize; fileSize = wosGetFileSizePP (wosOidStr); printf ("fileSize of %s = %lld\n", wosOidStr, fileSize); status = wosStageToCachePP (DEF_FILE_CREATE_MODE, 0, wosOidStr, (char *) DEST_FILE_NAME, fileSize); printf ("deleting %s\n", wosOidStr); status = wosFileUnlinkPP (wosOidStr); } }