LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

FileCopy Function Failes to return

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.
0 Kudos
Message 1 of 2
(2,915 Views)

The fact that Windows' Explorer also hangs is a big clue. It indicates an OS/network problem, not anything to do with your code or CVI libraries - after all, these library functions all go through the OS facilities to implement all file operations and if the OS fails to return there is not much CVI-based code can do about it.

JR

0 Kudos
Message 2 of 2
(2,898 Views)