I am trying to copy a text file from a Windows file system, thru a TotalNet interface, to a Unix box, and then back again. At times, the FileCopy CVI function simply failes to return after the second copy (back to PC).
// Save file to network
if( (result = CopyFile( holdFileSpec, netFileSpec )) != 0)
{
// copy operation failed
}
else
{
sprintf( glErrorMsg, "%s %s", netFileSpec, "Data File Copied to network" );
LogActivity( ErrorID, glErrorMsg, NETWORK );
}
// Calculate CRC on Network file after first copying it back to local PC
CRC_Net = 0;
MakePathname( DB_LOCAL_ENGUSEONLY_PATH, "NetworkFileCopy.CSV", NetworkFileCopy );
if( result = CopyFile( netFileSpec, NetworkFileCopy ) != 0 )
{
// copy back operation failed
sprintf( glErrorMsg, "%s %s", netFileSpec, "Data File Copied back fron network to Local PC failed" );
LogError ( ErrorID, glErrorMsg );
LogActivity( ErrorID, glErrorMsg, NETWORK );
status = FALSE;
continue; // quit this file and try the next
}
else
{
sprintf( glErrorMsg, "%s %s", netFileSpec, "Data File Copied back from network" );
LogActivity( ErrorID, glErrorMsg, NETWORK );
}
By "fails to return" I mean it never returns anything (including result codes) and the test application is permanently hung. If Windows Explorer is also running on the PC, it too is totally hung.
This behavior is unpredictable, worse when copying to/from some Unix directories and reliable with other. As directed in the setup for "FileCopy", CVI's "utility.h" is included in the function header and "FileCopy" calls are extensively, successfully used throughout the program.