[erlang-bugs] read_file_info returns garbage creation date for drives under Windows

John Hughes <>
Thu Feb 28 10:56:34 CET 2008


Start a new Erlang shell under Windows, and run

 

1> file:read_file_info("c:/").

{ok,{file_info,0,directory,read_write,

               {{1980,1,1},{0,0,0}},

               {{1980,1,1},{0,0,0}},

               {{0,0,1},{65165,1,0}},

               16895,1,3,0,0,0,0}}

 

Note the garbage creation date. A second call yielded

 

2> file:read_file_info("c:/").

{ok,{file_info,0,directory,read_write,

               {{1980,1,1},{0,0,0}},

               {{1980,1,1},{0,0,0}},

               {{0,0,0},{0,0,0}},

               16895,1,3,0,0,0,0}}

 

What creation date you see in a newly started shell varies. In general,
other calls of read_file_info can side-effect the creation date returned for
C:/. On my machine,

 

14> file:read_file_info("c:/Users/John
Hughes/Desktop"),file:read_file_info("c:/").

{ok,{file_info,0,directory,read_write,

               {{1980,1,1},{0,0,0}},

               {{1980,1,1},{0,0,0}},

               {{22,41,2007},{5,29,9}},

               16895,1,3,0,0,0,0}}

 

produces the same garbage creation time consistently, after the first time
it is called.

 

I have tested this with R11B-5 under XP, and R12B-0 and R12B-1 under
Vista-the behavior is similar under all three.

 

John Hughes

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20080228/9f9c6be7/attachment.html>


More information about the erlang-bugs mailing list