LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get entire date information with NI FTP tool?

Hi everyone, I have encountered a problem about retrieve file information via NI FTP tool, I want to get the entire date information such as:01-01-1904 00:00:00. But it seems not possible to get all information with 'FTP Directory Listing.vi' in NI FTP toolkit. It only provides part of them. for example:Mar 27 13:14 or Apr 09 2014. Could you please give some suggestion about this? Thanks a lot.
0 Kudos
Message 1 of 11
(2,604 Views)
attached the snapshot for your information.
Download All
0 Kudos
Message 2 of 11
(2,603 Views)

Hello panzer099,

 

can you tell me how you can display the date in "dd/mm/yyyy"?

I only receive "mmm dd hh:mm".

 

Thank you

0 Kudos
Message 3 of 11
(2,484 Views)

Hi Marcoh,

 

you can dive into the inner guts of the FTPDirectoryListing function.

So you can put a probe on the data that the "LIST" command reads from your FTP server: does that server even send the full date/timestamp information as requested?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 11
(2,460 Views)

Hi GerdW,

 

thank you for your reply. This is the whole String which I receive: "-rw-r--r-- 1 ftp ftp 5 Jul 08 13:29 Test.txt".

 

 

FTP_Data_Receive.jpg

0 Kudos
Message 5 of 11
(2,432 Views)

Hi marcoh,

 

so you can parse the received string on your own when the NI routines don't provide the answer you expect!?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 11
(2,424 Views)

Sorry Gerd, I don't get it. 

0 Kudos
Message 7 of 11
(2,418 Views)

Hi marcoh,

 


@marcoh87 wrote:

Sorry Gerd, I don't get it. 


When the FTP server sends the correct data, but NI's implementation of the FTP VIs does not parse the data correctly then you might create your own "FTP List" VI which does provide the correct data.

Use the existing NI implementation as a guide line when you create your own copy of this VI!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 11
(2,409 Views)

It seems to work when I receive the file info from an older File (one year ago). Then the format is mm dd yyyy.

 

Furthermore I will test your way. Thank you!

0 Kudos
Message 9 of 11
(2,406 Views)

It's definitely a server side issue. The FTP protocol was originally developed for command line operation. The parser on the receiving side for the List Directory command supposedly was meant to be a human, and humans are surprisingly good at guessing the correct thing from incomplete or changing information. So the actual formatting was not strictly defined and mostly just tried to be the same as whatever the according ls (Unix list command) would produce.

 


@marcoh87 wrote:

It seems to work when I receive the file info from an older File (one year ago). Then the format is mm dd yyyy.

 

Furthermore I will test your way. Thank you!


Could it be that these files are then on different volumes somehow? It seems that the older files get listed according to a different locale than the newer files. The locale on Unix based systems is the combination of country and language specific settings for numeric and date//time formats. There is nothing LabVIEW can do here for you. The problem is at the other side with the FTP server.

Rolf Kalbermatter
My Blog
0 Kudos
Message 10 of 11
(2,364 Views)