| Summary: | [CVS Core] invalid dirty indicator after checking out using command line cvs | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Igor Fedorenko <igor> |
| Component: | Team | Assignee: | Platform-VCM-Inbox <platform-vcm-inbox> |
| Status: | RESOLVED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P4 | CC: | roger.stoffers |
| Version: | 2.1 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 2000 | ||
| Whiteboard: | |||
|
Description
Igor Fedorenko
This may be a duplicate of 5337. Assigning for further assessment. I am running NTFS. Btw, I spent some time on this and I am pretty sure that the problem is due to difference in behaviour of (C functions) stat/utime used by command line cvs client and File.lastModified/setLastModified used by Eclipse. Basically, under Windows with auto daylight saving stat returns different values for the same file when daylight saving is on and when it is off and File.lastModified tries to compensate the difference. I guess the solution would be to use JNI to query/set last modified timestamp under Windows when the operation is related to content of CVS/Entries. Let me restate your findings just to confirm that I understand you correctly. If I have a file whose timestamp is "Monday, October 07, 2002, 8:19:04 PM" then the stat/utime function will return "Monday, October 07, 2002, 8:19:04 PM" with daylight savings time turned on and "Monday, October 07, 2002, 9:19:04 PM" with daylights savings time turned off. For the same file, Java will always return "Monday, October 07, 2002, 9:19:04 PM". Is this correct? Pretty much, with an exception that I compared seconds returned by stat with
milliseconds returned by lastModified.
Specifically, today (2 Jan 2003) stat says "1034036344" and File.lastModified
says "1034039944000". If I turn clocks on my computer to (2 Jul 2003), stat and
File.lastModified agree on "1034039944(000)".
I've included my test "programs". Note that I used "gcc -mno-cygwin" to compile
C. "-mno-cygwin" suppresses Posix compatibility layer provided by Cygwin and
should not be necessary with native win32 C compiler (which I do not have).
----------- daylight.c -------
#include <sys/stat.h>
#include <sys/types.h>
#include <stdio.h>
void main() {
struct stat s;
stat("C:\\temp\\buildmagic\\build\\xml.bat", &s);
printf("st_atime %u, st_ctime %u, st_mtime %u\n", s.st_atime, s.st_ctime,
s.st_mtime);
}
------------------------------
----------- Daylight.java -------
package test.daylight;
import java.io.File;
public class Daylight {
public static void main(String[] args) throws Exception {
System.out.println(new File
("C:\\temp\\buildmagic\\build\\build.xml").lastModified());
}
}
------------------------------
*** Bug 77570 has been marked as a duplicate of this bug. *** |