This email contained a .zip file attachment. Raytheon does not allow email attachments that are considered likely to contain malicious code. For your protection this attachment has been removed.
If this email is from an unknown source, please simply delete this email. If this email was expected, and it is from a known sender, you may follow the below suggested instructions to obtain these types of attachments. + Instruct the sender to enclose the file(s) in a ".zip" compressed file, and rename the ".zip" compressed file with a different extension, such as, ".rtnzip". Password protecting the renamed ".zip" compressed file adds an additional layer of protection. When you receive the file, please rename it with the extension ".zip". Additional instructions and options on how to receive these attachments can be found at: http://security.it.ray.com/antivirus/extensions.html http://security.it.ray.com/news/2007/zipfiles.html Should you have any questions or difficulty with these instructions, please contact the Help Desk at 877.844.4712 --- Caldarale, Charles R wrote: > From: André Warnier [mailto:a...@ice-sa.com] > Subject: Re: Disable class monitoring for reloading container classes > >> thanks for the perl program. > > I would not introduce yet another variable into situation, since perl is not > involved in any way with your Tomcat installation, and we don't know how a > particular perl implementation might decide to handle timestamps. I > recommended C and Java programs since those underly Tomcat, and trying to > pinpoint the exact location of the time discrepancy is likely crucial to > either fixing it or working around it. Until the actual source of the > problem is determined, you're just throwing darts - blindfolded. > Charles, I would not dream of disagreeing with you on a Java matter, but in this case, I will. The perl interpreter is usually as close as you can get to the underlying system's libraries without resorting to C, and a perl script is an order of magnitude easier to handle than a C program. What would be really nice, is if someone wrote a quick Java equivalent to the perl script I submitted. Now if you *really* insist, the modified version of the perl program, below, will explicitly use a couple of C functions, themselves using the builtin C structures to get the file's "last modified" time. Running C in perl, scary stuff.. ;-) The interesting bit however, is when I run this program alternatively on my Windows XP PC and on a Linux server, both set for the same "Berlin" timezone (GMT+1, current +1h of DST, so GMT+2), I get different answers. For a file in each case modified a few seconds ago, which would be around 12:00 GMT, a) Windows shows : C:\Programs\local>perl showmodified.pl showmodified.pl System raw timestamp : 1286712069 Current GMT time (no DST) : 2010/10/10-12:01:09 Current local time (with DST) : 2010/10/10-14:01:09 File [showmodified.pl]: last modified timestamp : 1286712049 the file was last modified 20 seconds ago last modified as GMT time (no DST) : 2010/10/10-12:00:49 last modified as local time (with DST) : 2010/10/10-14:00:49 b) Linux shows : a...@colin:~$ perl showmodified_C.pl showmodified_C.pl System raw timestamp : 1286712131 Current GMT time (no DST) : 2010/10/10-12:02:11 Current local time (with DST) : 2010/10/10-14:02:11 File [showmodified_C.pl]: last modified timestamp : 1286708460 the file was last modified 3671 seconds ago last modified as GMT time (no DST) : 2010/10/10-11:01:00 last modified as GMT time (no DST), as C would have it : 2010/10/10-11:01:00 last modified as local time (with DST) : 2010/10/10-13:01:00 last modified as local time (with DST), as C would have it : 2010/10/10-13:01:00 a...@colin:~$ Even more surprising, for once it seems (to me) that Windows is actually more logical. Or else, the underlying C libraries of Linux somehow adjust the values I'm getting. Windows appears to record (and return) the last modified time of a file as GMT/UTC, while Linux apparently records it as "local time", but without the DST adjustment. Or is it recording it as GMT, plus the DST adjustment ? (Unfortunately, the normal timezone here is GMT+1, and the DST adjustment right now is also +1 h, so I do not know which is which.) In any case, I get + one hour difference as compared to Windows, and what I get is nonsense. The file was not modified 3671 seconds ago, it was modified 71 seconds ago. Unfortunately also, changing the system time or its timezone, on the Linux system on which I am testing, is not an option for now. Finding information on the web specifically about different OS'es practices in terms of recording "last modified" times is apparently not easy. But I did find this rather old discussion of a similar issue, which seems to say the opposite of what I claim above : http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4860999 Can anyone smarter than I am throw more light on the subject ? Which, to bring it back closer to topic, could be rephrased as : does a JVM used by Tomcat always return a "correct" (or at least comparable) last modified timestamp for an application file, independently of the platform, time zones, and DST adjustments ? Perl script (also attached, zipped) : Note : you may need for this to first run : perl -MCPAN -e "install Inline::C" (and answer yes to all the questions) ---- start copying here --------- #!/usr/bin/perl # showmodified_C.pl use warnings; use strict; my ($sec,$min,$hour,$mday,$mon,$year); my $subject = $ARGV[0] or die "missing argument"; die "File not found or not readable : $!" unless ((-f $subject) && (-r $subject)); my $now = time(); print "System raw timestamp : $now\n"; ($sec,$min,$hour,$mday,$mon,$year) = gmtime($now); print "Current GMT time (no DST) : ",sprintf("%04d/%02d/%02d-%02d:%02d:%02d",$year+1900,$mon+1,$mday,$hour,$min,$sec),"\n"; ($sec,$min,$hour,$mday,$mon,$year) = localtime($now); print "Current local time (with DST) : ",sprintf("%04d/%02d/%02d-%02d:%02d:%02d",$year+1900,$mon+1,$mday,$hour,$min,$sec),"\n"; print "File [$subject]:\n"; my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, $atime,$mtime,$ctime,$blksize,$blocks) = stat($subject); print "last modified timestamp : $mtime\n"; print "the file was last modified ",$now-$mtime," seconds ago\n"; ($sec,$min,$hour,$mday,$mon,$year) = gmtime($mtime); print "last modified as GMT time (no DST) : ",sprintf("%04d/%02d/%02d-%02d:%02d:%02d",$year+1900,$mon+1,$mday,$hour,$min,$sec),"\n"; ($year,$mon,$mday,$hour,$min,$sec) = C_gmtime($mtime); print "last modified as GMT time (no DST), as C would have it : ",sprintf("%04d/%02d/%02d-%02d:%02d:%02d",$year+1900,$mon+1,$mday,$hour,$min,$sec),"\n"; ($sec,$min,$hour,$mday,$mon,$year) = localtime($mtime); print "last modified as local time (with DST) : ",sprintf("%04d/%02d/%02d-%02d:%02d:%02d",$year+1900,$mon+1,$mday,$hour,$min,$sec),"\n"; ($year,$mon,$mday,$hour,$min,$sec) = C_localtime($mtime); print "last modified as local time (with DST), as C would have it : ",sprintf("%04d/%02d/%02d-%02d:%02d:%02d",$year+1900,$mon+1,$mday,$hour,$min,$sec),"\n"; use Inline C => <<'END_OF_C_CODE'; #include <time.h> void C_localtime(int utc) { struct tm *ltime = localtime(&utc); Inline_Stack_Vars; Inline_Stack_Reset; Inline_Stack_Push(sv_2mortal(newSViv(ltime->tm_year))); Inline_Stack_Push(sv_2mortal(newSViv(ltime->tm_mon))); Inline_Stack_Push(sv_2mortal(newSViv(ltime->tm_mday))); Inline_Stack_Push(sv_2mortal(newSViv(ltime->tm_hour))); Inline_Stack_Push(sv_2mortal(newSViv(ltime->tm_min))); Inline_Stack_Push(sv_2mortal(newSViv(ltime->tm_sec))); Inline_Stack_Push(sv_2mortal(newSViv(ltime->tm_isdst))); Inline_Stack_Done; } void C_gmtime(int utc) { struct tm *ltime = gmtime(&utc); Inline_Stack_Vars; Inline_Stack_Reset; Inline_Stack_Push(sv_2mortal(newSViv(ltime->tm_year))); Inline_Stack_Push(sv_2mortal(newSViv(ltime->tm_mon))); Inline_Stack_Push(sv_2mortal(newSViv(ltime->tm_mday))); Inline_Stack_Push(sv_2mortal(newSViv(ltime->tm_hour))); Inline_Stack_Push(sv_2mortal(newSViv(ltime->tm_min))); Inline_Stack_Push(sv_2mortal(newSViv(ltime->tm_sec))); Inline_Stack_Push(sv_2mortal(newSViv(ltime->tm_isdst))); Inline_Stack_Done; } END_OF_C_CODE exit; ---- stop copying here --------- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org