NI Home > Community > NI Discussion Forums

LabVIEW

Showing results for 
Search instead for 
Do you mean 
Reply
Member
mischl
Posts: 19
0 Kudos

FTP: copy directory and indicate progress

hello all

 

i'm working on two challenges where i couldn't find any more details in the forum here.

 

1. to copy a directory from a server via ftp, there is no own vi for or? means that files in the directory has to been copy with 'FTP Retrieve Multiple' for example, create a local folder and put them in there, right?

 

2. to find out when the whole process is finished, what possibilities are there? the status out isn't usable for this as i see it. i tried to use the 'get file size' vi of the local while copying it and to compare it with the original file. unfortunately, the local file seems to be created at the end of the process and so it couldn't be parsed while...

 

thanks for any hint. perhaps i made also some wrong thoughts about it...

 

Trusted Enthusiast
Christian Mergl
Posts: 2,604
0 Kudos

Re: FTP: copy directory and indicate progress

Hi,

 

The Internet Toolkit provides FTP functions to get and put files, read contents, directories and there are also VI's for the status of the FTP transaction.

 

 

Christian

Member
mischl
Posts: 19
0 Kudos

Re: FTP: copy directory and indicate progress

hi christian

 

thanks for your answer.

i've still installed the internet toolkit with the ftp vi's as well as the intermediate ftp vi's.

 

but my two questions stays still open. could you describe me the solutions a bit more in detail please?

1. what is the (simplest) way to copy a whole directory?

2. how to control the remaining time of a file transfer?

 

thanks a lot in advance

Active Participant
dan_u
Posts: 1,195
0 Kudos

Re: FTP: copy directory and indicate progress


mischl wrote:

 

1. what is the (simplest) way to copy a whole directory?

2. how to control the remaining time of a file transfer?


I think there's no simple solution to both of your requests when using the NI Internet toolkit FTP functions.

1. The simplest might be a recursive approach: for a directory, create local directory, list remote directory contents, copy files into corresponding local directory. For directories, call the VI recursively.

2. There's no direct way. The FTP VIs are open, so you can dig into the FTP Data Receive.vi > TCP Read Stream.vi. There the data is read from the TCP connection in chunks of 4096 bytes. So there you have the information. But I wouldn't recommend changing the toolkit VIs, this creates non-portable code. If you want to modify the VIs, create a copy of the modified VIs in your project.