Can I detect an FTP file transfer programmatically?

I implemented a function to read a parameters file. We allow the customer to update the file and transfer it using FTP.

I retrieve the parameters from the file at startup and use them.

Is there a way to detect that the user has transferred an updated file via FTP?

I thought that the husFileIO structure might have something.

But when I watched this, the device, filename, and dest changed with each power cycle; whether the file was updated or not.

I could watch the filesize and see if it changes. This would capture some of the times that the customer made changes. Unfortunately, it is quite likely that the changed file will be the same size.

Any thoughts?

Hi there,

“husFileIO” is something someone else implemented, nothing provided by B&R.
That being said, I see “FOpen” and “FCreate” in there already, so chances are you find an instance of FileInfo as well.
This FUB provides you with data of type fiFILE_INFO and that contains modTime (modification time) - that should do it. Cyclically check for changes there and you have what you need

2 Likes

Agree with Michael, FileInfo should be solution you are looking for.

Yes. FileInfo shows the modification time for the file when I download it via FTP. So I’ll have to periodically check to see if the file has changed. Thanks for the insight.

1 Like