Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Millenium Bug in "info?" function - returns bad date.

 [1/3] from: doug::vos::eds::com at: 4-Jan-2001 10:50


I've found a bug in the info? function. Returns bad date. Example: info? reports file date of 21-Dec-2001 for file created on 21-Dec-2000. Background: In my production web-server environment I run Sun-Solaris. My local Win-95 PC also runs REBOL/Core 2.3 and does some remote maintenance of files, refreshing files and deleting old files every night. After the Jan 2, 2001 I noticed that the remote file delete script was no longer working. Curious as to why I used probe to examine the results of info? via the ftp connection and discovered that the reason no old files were being deleted was because all the files from Dec-2000 were now being intepreted as Dec-2001. I verified this in a file by file check with my other FTP tools.
>> probe info? xfile
make object! [ size: 1024 date: 19-Dec-2001/14:27 type: file ]
>>
File ...COFG11214-201.txt... is -349 days old. NOTE: This file is actually dated 19-Dec-2000 Files are supposed to be deleted if older than 5 days, so now this calculation does not work and I must delete old files manually until I get a bug fix. This seems to be the case under REBOL/Core 2.2 and 2.3 Info? does not appear to have this problem on local files, but only when used via FTP. What is the real scope of this bug? Any other versions effected? Has anyone else seen problems like this? Any temporary work arounds? Suggestions? Douglas Vos - EDS/GM-BSU Webmaster e-Mail: mailto:[doug--vos--eds--com]

 [2/3] from: rebol:techscribe at: 4-Jan-2001 13:10


Hi Doug, Using my Linux box I ftp'd to a remote site and did an ls on that site. ls returned November and December dates without years. If you look at REBOL's ftp scheme you'll notice that when REBOL parses the returned date, if the parsed date < 3, then REBOL adds the current year. That's where the bug is (in the add-date function that is embedded in the parse-files function of the ftp scheme.) The add-date function, add-date: func [] [ month: first pdate system/words/remove pdate system/words/insert skip pdate 1 month if (length? pdate) < 3 [ system/words/append pdate now/year system/words/append pdate to-time time ] in addition to checking for the length of pdate should also check for the month's value, and append now/year - 1, if month > current-month. You can implement the changes yourself if you want. 1. Save the ftp prototype scheme to a file. 2. Make your changes in that file. 3. use net-utils net-install function to install your modified ftp prototocol. Hope this helps, Elan Vos, Doug wrote:

 [3/3] from: rebol:techscribe at: 4-Jan-2001 13:09


Hi Doug, Using my Linux box I ftp'd to a remote site and did an ls on that site. ls returned November and December dates without years. If you look at REBOL's ftp scheme you'll notice that when REBOL parses the returned date, if the parsed date < 3, then REBOL adds the current year. That's where the bug is (in the add-dates function that is embedded in the parse-files function of the ftp scheme.) The add-dates function, add-date: func [] [ month: first pdate system/words/remove pdate system/words/insert skip pdate 1 month if (length? pdate) < 3 [ system/words/append pdate now/year system/words/append pdate to-time time ] in addition to checking for the length of pdate should also check for the month's value, and append now/year - 1, if month > current-month. You can implement the changes yourself if you want. 1. Save the ftp prototype scheme to a file. 2. Make your changes in that file. 3. use net-utils net-install function to install your modified ftp prototocol. Hope this helps, Elan Vos, Doug wrote: