Still problems with valid times
Dynamically changing modification, access, and change time components
Status: Beta
Brought to you by:
welle
Sorry for being so blunt, but are the problems with stroke rejecting valid times ever going to get fixed?
I run into things like this all the time:
# touch file
# stroke -i file
stroke: file
stroke: mtime: 08/01/2011-06:53:12 Mon (-dst)
stroke: atime: 08/01/2011-06:53:12 Mon (-dst)
stroke: ctime: 08/01/2011-06:53:12 Mon (-dst)
# touch -d '20110731 10:14:30' file
# stroke -i file
stroke: ** ERROR: Date validation failed: "07/31/2011-10:14:30 Sun (-dst)"
There is nothing wrong with that time, but stroke can't work with it.
I made this only change to the source and it seems to validate dates better:
Checked with
Last edit: Alberto Varesio 2020-10-15
Hello Albert,
I don't think your fix is correct. Although it seems to work in your case, just replacing the logical && with a bitwise AND-operator is not the correct fix here in my opinion. The code has some logical issues in my opinion.
Best regards,
Sören
Hi Sören
Yes maybe code needs a rewrite, but I remember to have tested it against a
full year of dates and it looked correct.
With the logical AND code is testing an integer value ( months shifted by
the value of D ) which will always result in a > 0 value, which will always
be considered true, so the second test is ineffective until December.
With bitwise AND the same value is ANDed with a 0/1 from the second
condition, so it will get true/false on the right months, hopefully
Regards
On Sun, Nov 15, 2020 at 6:01 PM "Sören Wellhöfer" welle@users.sourceforge.net wrote:
--
Alberto 'JCN-9000' Varesio
IT Administrator
Mobile: +39 393 101 8844
LI: http://www.linkedin.com/in/albertovaresio
Related
Bug reports: #6