get file date & time modification

Discussions about CSEntry
Mariovaisman
Posts: 78
Joined: February 11th, 2013, 8:26 am

get file date & time modification

Postby Mariovaisman » July 19th, 2018, 3:28 am

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

josh
Posts: 1634
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: get file date & time modification

Postby josh » July 19th, 2018, 3:58 am

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.

Mariovaisman
Posts: 78
Joined: February 11th, 2013, 8:26 am

Re: get file date & time modification

Postby Mariovaisman » July 19th, 2018, 5:08 am

Thnk you Josh,

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

Thanks

Mario

josh
Posts: 1634
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: get file date & time modification

Postby josh » July 19th, 2018, 7:32 am

What would you use it for?

Mariovaisman
Posts: 78
Joined: February 11th, 2013, 8:26 am

Re: get file date & time modification

Postby Mariovaisman » July 21st, 2018, 5:51 am

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

Mariovaisman
Posts: 78
Joined: February 11th, 2013, 8:26 am

Re: get file date & time modification

Postby Mariovaisman » July 23rd, 2018, 11:45 am

Sorry if continue with this.

The function could be FILEDATE and/or FILETIME

Thanks

Mario

josh
Posts: 1634
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: get file date & time modification

Postby josh » July 23rd, 2018, 3:32 pm

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?

Mariovaisman
Posts: 78
Joined: February 11th, 2013, 8:26 am

Re: get file date & time modification

Postby Mariovaisman » July 23rd, 2018, 6:00 pm

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

Gregory Martin
Posts: 1037
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: get file date & time modification

Postby Gregory Martin » July 29th, 2018, 12:04 am

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.

Mariovaisman
Posts: 78
Joined: February 11th, 2013, 8:26 am

Re: get file date & time modification

Postby Mariovaisman » July 29th, 2018, 8:25 am

Thanks Gregory,

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

Best

Mario


Return to “Entry”