LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Copy a file from one computer to another

Solved!
Go to solution

Hi All,

 

I am trying to copy a file from a computer (where I have CVI program running) to another computer on the same network. How should I be doing it ? Should I use socket functions library provided by C or is there any other library available in labwindows?

 

Thanks,

Kanu

0 Kudos
Message 1 of 4
(3,157 Views)
Solution
Accepted by Kanu

CopyFile ( ) in the Utility library accepts UNC pathnames, so you can do something like this:

 

CopyFile ("myfile.txt", "\\\\remotePC\\remoteFolder\\myfile.txt");

 

Care must be taken to avoid conflicts between this function and the corresponding Windows API function with the same name: read the online help for explanations.

 

Simpler is better, don't you think? Smiley Wink



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 4
(3,153 Views)

hello sir im trying this one its giving -1 value its nothing but File not found or directory in path not found.pls help me 

0 Kudos
Message 3 of 4
(2,928 Views)

A few question to permit understanding what's happening:

Is the source file present in the given folder?

Is the target folder availble for writing (i.e. there is no network constraint)?

Can you post the relevant code?



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 4
(2,923 Views)