Page 1 of 1

get file date & time modification

Posted: July 19th, 2018, 3:28 am
by Mariovaisman
Hello all,

I am trying to know the date and time of files in a cspro application, like we see when we are using explorer or other software. Also need to know using the app in Android devices. I couldn't find the way to do it. There is the dirlist function that gives only the name and the full path but no more information. Is it possible, and how.

Thanks

Mario

Re: get file date & time modification

Posted: July 19th, 2018, 3:58 am
by josh
Unfortunately there is no function for that in CSPro. On Windows you could hack something together using execsystem but on Android I can't see any way to do it.

Re: get file date & time modification

Posted: July 19th, 2018, 5:08 am
by Mariovaisman
Thnk you Josh,

Is it possible to have this function in a future cspro version?

Thanks

Mario

Re: get file date & time modification

Posted: July 19th, 2018, 7:32 am
by josh
What would you use it for?

Re: get file date & time modification

Posted: July 21st, 2018, 5:51 am
by Mariovaisman
Thanks for your answer.
I need to do some analysis with the creation or modification date and time, and with that information I can speed up some process.

Thanks

Mario

Re: get file date & time modification

Posted: July 23rd, 2018, 11:45 am
by Mariovaisman
Sorry if continue with this.

The function could be FILEDATE and/or FILETIME

Thanks

Mario

Re: get file date & time modification

Posted: July 23rd, 2018, 3:32 pm
by josh
Would you need this function if syncfile was smart enough to only transfer files that had changed since they were last transferred or would you use it outside of sync?

Re: get file date & time modification

Posted: July 23rd, 2018, 6:00 pm
by Mariovaisman
In fact one of the functionality is for file transfers that I have to do using FTPS, and it is not possible to do it using a different technology because it is part of the terms of reference and it is audited by CDC.

In the current application version we are sending all data based on the cluster number that is currently open, however most of those files do not have differences from the previous transmission, and in the central office, those files appear as new version and are downloaded taking much additional time to complete the process.

Thanks

Mario

Re: get file date & time modification

Posted: July 29th, 2018, 12:04 am
by Gregory Martin
It requires some programming, but you could create a lookup file that keeps tracks of files synced as well as their MD5 hash, which you can get with this function:

http://www.csprousers.org/help/CSPro/di ... ction.html

Then, whenever you want to check whether you should send a file, you would lookup the filename in the lookup file, compare if the MD5 hash has changed, and only upload the file if it has. In that case, you would writecase the new MD5 hash value.

Re: get file date & time modification

Posted: July 29th, 2018, 8:25 am
by Mariovaisman
Thanks Gregory,

It works very fine, and it is exactly what I need.

Best

Mario