www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Wrong DirEntry dates

reply Carlos Santander <csantander619 gmail.com> writes:
DirEntry is wrong everywhere but Windows.

//--------------------
import std.date;
import std.file;
import std.stdio;

void main ()
{
         listdir (".", delegate bool (DirEntry * de)
         {
                 writefln ("%s : %s", de.name, toUTCString (de.lastWriteTime));
                 return true;
         }
         );
}
//--------------------

DMD 0.160, Linux x86:

$ ls -l
total 304
-rwxr-xr-x  1 carlos carlos 298013 jun 14 10:50 test*
-rw-r--r--  1 carlos carlos    211 jun 14 10:50 test.d
-rw-r-----  1 carlos carlos   2856 jun 14 10:50 test.o

$ ./test
./test.d : Tue, 23 Dec 1969 07:22:57 UTC
./test.o : Tue, 23 Dec 1969 07:23:35 UTC
./test : Tue, 23 Dec 1969 07:23:35 UTC


GDC 0.18 (DMD 0.160, SF revision 5), Linux PPC:

$ ls -l
total 696
-rwxr-xr-x  1 carlos carlos 698694 2006-06-14 10:52 test
-rw-r--r--  1 carlos carlos    211 2006-06-14 10:52 test.d
-rw-r--r--  1 carlos carlos   3240 2006-06-14 10:52 test.o

$ ./test
./test.d : Tue, 23 Dec 1969 07:24:56 UTC
./test.o : Tue, 23 Dec 1969 07:25:03 UTC
./test : Tue, 23 Dec 1969 07:25:05 UTC


GDC 0.18 (DMD 0.160, SF revision 5), Mac OS X PPC:

$ ls -l
total 1656
-rwxr-xr-x   1 carlos  carlos  835984 Jun 14 10:41 test
-rw-r--r--   1 carlos  carlos     211 Jun 14 10:41 test.d
-rw-r--r--   1 carlos  carlos    3284 Jun 14 10:41 test.o

$ ./test
./test : Tue, 23 Dec 1969 07:14:42 UTC
./test.d : Tue, 23 Dec 1969 07:14:40 UTC
./test.o : Tue, 23 Dec 1969 07:14:42 UTC


-- 
Carlos Santander Bernal
Jun 14 2006
parent Walter Bright <newshound digitalmars.com> writes:
Carlos Santander wrote:
 DirEntry is wrong everywhere but Windows.

Turns out to be an integer overflow. A fix will go out in the next update.
Jun 15 2006