[xmail] Re: log filenames

2004-04-08 Thread Ladislav Sedivy
Davide Libenzi wrote:
 On Wed, 7 Apr 2004, Ladislav Sedivy wrote:
 
 
Ok, I built it with Visual Studio 6 (SP5):

[LINKY] C:\mailroot\bin
 xtestv6
** From Main **
time = Wed Apr 07 19:56:34 2004
timezone = 18000
isdst= 1
tutc = 1081382194
tloc = 1081367794
tval = 1081310400
rotstr   = 20040407
** From Thread (No tzset) **
time = Wed Apr 07 19:56:34 2004
timezone = 18000
isdst= 1
tutc = 1081382194
tloc = 1081367794
tval = 1081310400
rotstr   = 20040407
** From Thread (tzset) **
time = Wed Apr 07 19:56:34 2004
timezone = 18000
isdst= 1
tutc = 1081382194
tloc = 1081367794
tval = 1081310400
rotstr   = 20040407


What now? :)
 
 
 Try to rebuild XMail, and see how it generates log files ...
 
 
 
 - Davide

Well, before I had a chance to rebuild it, it createated a new set of 
logs all ending with .  Go figure...

Lac
-
To unsubscribe from this list: send the line unsubscribe xmail in
the body of a message to [EMAIL PROTECTED]
For general help: send the line help in the body of a message to
[EMAIL PROTECTED]



[xmail] Re: log filenames

2004-04-07 Thread Ladislav Sedivy
Davide Libenzi wrote:
 On Tue, 6 Apr 2004, Ladislav Sedivy wrote:
 
 
Davide Libenzi wrote:

Ouch. The test program uses exactly the same formula XMail uses to 
generate log file names, and here all rotstr are fine (ending with 
).



- Davide

Could it be one of the std libs?  Or whereever the time functions are. 
I built the test program with .NET compiler and linker.
 
 
 Try to build XMail with that and let me know. I use VC6-SP5.
 
 - Davide

Ok, I built it with Visual Studio 6 (SP5):

[LINKY] C:\mailroot\bin
 xtestv6
** From Main **
time = Wed Apr 07 19:56:34 2004
timezone = 18000
isdst= 1
tutc = 1081382194
tloc = 1081367794
tval = 1081310400
rotstr   = 20040407
** From Thread (No tzset) **
time = Wed Apr 07 19:56:34 2004
timezone = 18000
isdst= 1
tutc = 1081382194
tloc = 1081367794
tval = 1081310400
rotstr   = 20040407
** From Thread (tzset) **
time = Wed Apr 07 19:56:34 2004
timezone = 18000
isdst= 1
tutc = 1081382194
tloc = 1081367794
tval = 1081310400
rotstr   = 20040407


What now? :)

Lac
-
To unsubscribe from this list: send the line unsubscribe xmail in
the body of a message to [EMAIL PROTECTED]
For general help: send the line help in the body of a message to
[EMAIL PROTECTED]



[xmail] Re: log filenames

2004-04-07 Thread Davide Libenzi
On Wed, 7 Apr 2004, Ladislav Sedivy wrote:

 Ok, I built it with Visual Studio 6 (SP5):
 
 [LINKY] C:\mailroot\bin
  xtestv6
 ** From Main **
 time = Wed Apr 07 19:56:34 2004
 timezone = 18000
 isdst= 1
 tutc = 1081382194
 tloc = 1081367794
 tval = 1081310400
 rotstr   = 20040407
 ** From Thread (No tzset) **
 time = Wed Apr 07 19:56:34 2004
 timezone = 18000
 isdst= 1
 tutc = 1081382194
 tloc = 1081367794
 tval = 1081310400
 rotstr   = 20040407
 ** From Thread (tzset) **
 time = Wed Apr 07 19:56:34 2004
 timezone = 18000
 isdst= 1
 tutc = 1081382194
 tloc = 1081367794
 tval = 1081310400
 rotstr   = 20040407
 
 
 What now? :)

Try to rebuild XMail, and see how it generates log files ...



- Davide


-
To unsubscribe from this list: send the line unsubscribe xmail in
the body of a message to [EMAIL PROTECTED]
For general help: send the line help in the body of a message to
[EMAIL PROTECTED]



[xmail] Re: log filenames

2004-04-06 Thread Davide Libenzi
On Mon, 5 Apr 2004, Ladislav Sedivy wrote:

 C:\lang\projects\xtest
  cl xtest.c /MT
 Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
 Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
 
 xtest.c
 Microsoft (R) Incremental Linker Version 7.10.3077
 Copyright (C) Microsoft Corporation.  All rights reserved.
 
 /out:xtest.exe
 xtest.obj
 
 C:\lang\projects\xtest
  xtest
 ** From Main **
 time = Mon Apr 05 19:30:08 2004
 timezone = 18000
 isdst= 1
 tutc = 1081207808
 tloc = 1081193408
 tval = 1081137600
 rotstr   = 20040405
 ** From Thread (No tzset) **
 time = Mon Apr 05 19:30:08 2004
 timezone = 18000
 isdst= 1
 tutc = 1081207808
 tloc = 1081193408
 tval = 1081137600
 rotstr   = 20040405
 ** From Thread (tzset) **
 time = Mon Apr 05 19:30:09 2004
 timezone = 18000
 isdst= 1
 tutc = 1081207809
 tloc = 1081193409
 tval = 1081137600
 rotstr   = 20040405

Ouch. The test program uses exactly the same formula XMail uses to 
generate log file names, and here all rotstr are fine (ending with 
).



- Davide


-
To unsubscribe from this list: send the line unsubscribe xmail in
the body of a message to [EMAIL PROTECTED]
For general help: send the line help in the body of a message to
[EMAIL PROTECTED]



[xmail] Re: log filenames

2004-04-06 Thread Ladislav Sedivy
Davide Libenzi wrote:
 
 Ouch. The test program uses exactly the same formula XMail uses to 
 generate log file names, and here all rotstr are fine (ending with 
 ).
 
 
 
 - Davide

Could it be one of the std libs?  Or whereever the time functions are. 
I built the test program with .NET compiler and linker.

Compiler Version 13.10.3077
Linker Version 7.10.3077

Lac
-
To unsubscribe from this list: send the line unsubscribe xmail in
the body of a message to [EMAIL PROTECTED]
For general help: send the line help in the body of a message to
[EMAIL PROTECTED]



[xmail] Re: log filenames

2004-04-06 Thread Davide Libenzi
On Tue, 6 Apr 2004, Ladislav Sedivy wrote:

 Davide Libenzi wrote:
  
  Ouch. The test program uses exactly the same formula XMail uses to 
  generate log file names, and here all rotstr are fine (ending with 
  ).
  
  
  
  - Davide
 
 Could it be one of the std libs?  Or whereever the time functions are. 
 I built the test program with .NET compiler and linker.

Try to build XMail with that and let me know. I use VC6-SP5.



- Davide


-
To unsubscribe from this list: send the line unsubscribe xmail in
the body of a message to [EMAIL PROTECTED]
For general help: send the line help in the body of a message to
[EMAIL PROTECTED]



[xmail] Re: log filenames

2004-04-05 Thread Francesco Vertova
You wrote:

 Can someone tell me the logic in which last four digits are generated? 
 I see the following ones 0100,  and the current ones 2300.
 Running 1.17 on Win2k.

In theory, they should always end in  and rotate daily unless you set a shorter 
rotation time with -Mr (I think) command line switch.

As a matter of fact, there is an obscure bug which surfaces on many systems and causes 
incorrect log file names to be generated from time to time.

On my system (NT4 SP6a, I only experimented with 1.17), log file name rotation behaves 
like this:

 all year until the very time when DST starts or ends; then, if DST starts they 
end in 0100 for the rest of the day, if DST ends they end in 2300 - and the date rolls 
back one day - for the rest of the day. From the day after everything is normal again.

Ciao, Francesco

-
To unsubscribe from this list: send the line unsubscribe xmail in
the body of a message to [EMAIL PROTECTED]
For general help: send the line help in the body of a message to
[EMAIL PROTECTED]



[xmail] Re: log filenames

2004-04-05 Thread Ladislav Sedivy
Davide Libenzi wrote:
 On Sun, 4 Apr 2004, Ladislav Sedivy wrote:
 
 
Can someone tell me the logic in which last four digits are generated? 
I see the following ones 0100,  and the current ones 2300.
Running 1.17 on Win2k.
 
 
 They all should be . Can you try to stop and start XMail to see if it 
 generates  names?
 
 
 
 - Davide

I restarted and they still end with 2300.

Lac
-
To unsubscribe from this list: send the line unsubscribe xmail in
the body of a message to [EMAIL PROTECTED]
For general help: send the line help in the body of a message to
[EMAIL PROTECTED]



[xmail] Re: log filenames

2004-04-05 Thread Davide Libenzi
On Mon, 5 Apr 2004, Ladislav Sedivy wrote:

 I restarted and they still end with 2300.

Can you try to build and run the following program on your machine?


- Davide





/*
 * gcc -o timetest timetest.c -lpthread
 */

#include stdio.h
#include stdlib.h
#include time.h
#ifdef __GNUC__
#include pthread.h
#else
#include windows.h
#endif


#ifdef __GNUC__
#define time_zone() ((long) timezone)
#else
#define time_zone() ((long) _timezone)
#endif


unsigned long trot = 24 * 3600;
int done = 0;



void *test_time(void *ptr) {
unsigned long tloc, tval;
time_t tcur, rott;
struct tm tml, tmr;

if (ptr)
tzset();
tcur = time(NULL);
tml = *localtime(tcur);
tloc = (unsigned long) tcur - time_zone() + tml.tm_isdst * 3600;
tval = (tloc / trot) * trot + time_zone() - tml.tm_isdst * 3600;
rott = (time_t) tval;
tmr = *localtime(rott);
printf(time = %s
   timezone = %ld\n
   isdst= %d\n
   tutc = %lu\n
   tloc = %lu\n
   tval = %lu\n
   rotstr   = %04d%02d%02d%02d%02d\n,
   ctime(tcur), time_zone(), tml.tm_isdst, (unsigned long) tcur, tloc, 
tval,
   tmr.tm_year + 1900, tmr.tm_mon + 1,
   tmr.tm_mday, tmr.tm_hour, tmr.tm_min);

done++;
return NULL;
}


#ifdef __GNUC__

int run_thread(void *(*proc)(void *), void *ptr) {
pthread_attr_t thattr;
pthread_t thid;

pthread_attr_init(thattr);
pthread_attr_setdetachstate(thattr, PTHREAD_CREATE_DETACHED);

if (pthread_create(thid, thattr, proc, ptr) != 0) {
perror(pthread_create());
exit(1);;
}
pthread_attr_destroy(thattr);

return 0;
}


void tmsleep(int msec) {

usleep(msec * 1000);
}

#else

int run_thread(void *(*proc)(void *), void *ptr) {
unsigned int tid;
unsigned long thr = _beginthreadex(NULL, 0, (unsigned (__stdcall *) (void *)) 
proc, ptr,
   0, tid);

return 0;
}


void tmsleep(int msec) {

Sleep(msec);
}

#endif



int main(int argc, char *argv[]) {

if (argc  1)
trot = 3600 * atoi(argv[1]);
tzset();
printf(** From Main **\n);
test_time((void *) 1);

printf(** From Thread (No tzset) **\n);
done = 0;
run_thread(test_time, (void *) 0);
while (!done)
tmsleep(200);

printf(** From Thread (tzset) **\n);
done = 0;
run_thread(test_time, (void *) 1);
while (!done)
tmsleep(200);

return 0;
}


-
To unsubscribe from this list: send the line unsubscribe xmail in
the body of a message to [EMAIL PROTECTED]
For general help: send the line help in the body of a message to
[EMAIL PROTECTED]



[xmail] Re: log filenames

2004-04-05 Thread Ladislav Sedivy
Davide Libenzi wrote:
 On Mon, 5 Apr 2004, Ladislav Sedivy wrote:
 
 
I restarted and they still end with 2300.
 
 
 Can you try to build and run the following program on your machine?
 
 
 - Davide

All right.  Here it goes:


C:\lang\projects\xtest
 cl xtest.c /MT
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.

xtest.c
Microsoft (R) Incremental Linker Version 7.10.3077
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:xtest.exe
xtest.obj

C:\lang\projects\xtest
 xtest
** From Main **
time = Mon Apr 05 19:30:08 2004
timezone = 18000
isdst= 1
tutc = 1081207808
tloc = 1081193408
tval = 1081137600
rotstr   = 20040405
** From Thread (No tzset) **
time = Mon Apr 05 19:30:08 2004
timezone = 18000
isdst= 1
tutc = 1081207808
tloc = 1081193408
tval = 1081137600
rotstr   = 20040405
** From Thread (tzset) **
time = Mon Apr 05 19:30:09 2004
timezone = 18000
isdst= 1
tutc = 1081207809
tloc = 1081193409
tval = 1081137600
rotstr   = 20040405


Lac
-
To unsubscribe from this list: send the line unsubscribe xmail in
the body of a message to [EMAIL PROTECTED]
For general help: send the line help in the body of a message to
[EMAIL PROTECTED]



[xmail] Re: log filenames

2004-04-04 Thread Davide Libenzi
On Sun, 4 Apr 2004, Ladislav Sedivy wrote:

 Can someone tell me the logic in which last four digits are generated? 
 I see the following ones 0100,  and the current ones 2300.
 Running 1.17 on Win2k.

They all should be . Can you try to stop and start XMail to see if it 
generates  names?



- Davide


-
To unsubscribe from this list: send the line unsubscribe xmail in
the body of a message to [EMAIL PROTECTED]
For general help: send the line help in the body of a message to
[EMAIL PROTECTED]