Re:Re : Fun Java <-> Windows file timestamp bug
Kadaitcha Man[Thu, 13 Nov 2003 17:05:51
-0800].<
e42881a8.0311131705.780f11d7@posting.google.com>+=
Quote
The Ghost In The Machine wrote:
Quote
I'm hoping this one's been reported already, but it's a weird one.
---- file fts.java ----
import java.io.*;
public class fts
{
public static void main(String[] args) throws Exception
{
FileOutputStream fos = new
FileOutputStream("d_fts.dat"); BufferedOutputStream
bos = new BufferedOutputStream(fos); while(true)
{
bos.write(new
java.util.Date().toString().getBytes());
for(int i = 0; i < 60; i++)
bos.write('*');
bos.write('\n');
Thread.sleep(5000L);
}
}
}
----
As you can probably see, this simply creates a file
d_fts.dat and then writes to it on a periodic basis.
Works fine on a new create on both Linux and Windows,
but if d_fts.dat exists already on Windows, the timestamp
on that file will not be updated after initial open until
the program is forced to exit with a control-C. However,
the size of the file and its contents do update.
Windows does not update a file's modified timestamp until you close
the open file handle.
Windows makes you stupid.
--
Kadaitcha Man: Kicking fuckwits in the head on Usenet since 1989
kadaitcha.kicks-ass.org/
Linux makes you stupid
That's nothing.
At work, we use a java server app
that will import a CSV file into
a sql svr db and
randomly shift the decimal point
on numeric fields (!)
How can this be? Does java have any
flaws with floating point? Isn't that
the type of thing that 'safe' languages
prevent? Or is it the Xeon processors?
How could that happen? To me, it seems
impossible -- but there it is -- random
shifts in the position of the decimal
on a text file import via a java service
(not java server, or java server pages, but
an EJB type application written as
a Windos server) to a database?
How?
-