Stefan Bodewig wrote:
>On Wed, 09 Oct 2002, Jerome Lacoste <[EMAIL PROTECTED]> wrote:
>
>
>
>>copy identifies files are up to date while they aren't.
>>
>>
>
>Works on my machine (running Linux).
>
>Uhm, this here might be the problem on Windows:
>
> if (forceOverwrite ||
> (file.lastModified() > destFile.lastModified())) {
>
>does anybody know what File#lastModified returns for a file that
>doesn't exist at all? The javadocs say it is supposed to be 0L, but
>maybe this isn't true for all JDKs?
>
On my machine, with the attached test case:
JVM: 1.4.1 Sun Microsystems Inc.(1.4.1-b21)
OS: Windows NT 4.0
Non-existent file exists? false
Non-existent file last modified: 0
/*
* FileModified.java
*
* Created on October 14, 2002, 10:17 AM
*/
package no.bbc.test;
import java.io.*;
/**
* This is related to a possible bug in Ant 1.5
* @author Jerome
*/
public class FileModified
{
/** Creates a new instance of FileModified */
public FileModified() {
}
public static void main(String[] args)
{
System.out.println("JVM: " + System.getProperty("java.version") + " " +
System.getProperty("java.vm.vendor") + "(" +
System.getProperty("java.vm.version") + ")");
System.out.println("OS: " + System.getProperty("os.name") + " " +
System.getProperty("os.version"));
File f = new File("non-existingfile.txt");
System.out.println("Non-existent file exists? \t" + f.exists());
System.out.println("Non-existent file last modified: " + f.lastModified());
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>