Showing results for 
Search instead for 
Did you mean: 
Reply

FTP: copy directory and indicate progress

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...

 

0 Kudos
Message 1 of 4 (789 Views)
Reply
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

0 Kudos
Message 2 of 4 (781 Views)
Reply
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

0 Kudos
Message 3 of 4 (760 Views)
Reply
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.

 

 

0 Kudos
Message 4 of 4 (755 Views)
Reply
0 Kudos
//this script is to ensure MY ACCOUNT is loaded and then paste the info into the nav