Hi all,
please i want to know if there is a function who return the date of the modification of a file, like :
Date("C:\test.dat") returns 07/06/2018.
or how can i do if i want to use in logic the last date of modification of a file ?
i want to compare two versions of a file in differents folders and just take the most recent.
Thanks.
how return the date of modification of a file in the logic
-
- Posts: 572
- Joined: July 9th, 2012, 11:32 am
- Location: Islamabad, Pakistan
Re: how return the date of modification of a file in the logic
Dear
Maybe You can use log file to get the last date of modification or addition and I hope it works for you or josh and Gregory give you a better solution.
The syntax for 7.1.2 is as follows:
But in your case you need time as well because if there is no change in date but change in time. In this case you will use the range:
Best.
a.
Maybe You can use log file to get the last date of modification or addition and I hope it works for you or josh and Gregory give you a better solution.
The syntax for 7.1.2 is as follows:
Code: Select all
File Datefile;
String PreLoad_Data;
numeric i = setfile (Datelog, "..\Data\firstfile.csdb.log");//set first file
while fileread (Datelog, PreLoad_Data) do; //run loop to read file till end
string firstfiledate=PreLoad_Data[38:10]; //38: is starting point in log file
//10: is number of digits
//These information you can get from the help file "LOG"
enddo;
close(Datelog); //Close first log file
i = setfile (Datelog, "..\Data\secondfile.csdb.log");// set second file
while fileread (Datelog, PreLoad_Data) do;
string secondfiledate=PreLoad_Data[38:10];
enddo;
close(Datelog);
if firstfiledate=secondfiledate then
errmsg ("Use first file");
else
errmsg ("Use second file");
endif;
Code: Select all
string firstfiledate=PreLoad_Data[38:19];
string secondfiledate=PreLoad_Data[38:19];
Best.
a.
Re: how return the date of modification of a file in the logic
Hi Khurshid !
Thanks a lot !
Thanks a lot !