[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sylpheed
Subject:    [sylpheed:09688] Re: Inbox updates not working ...update
From:       "Joachim F. Selinger" <selinger () bawue ! de>
Date:       2002-01-31 15:11:48
[Download RAW message or body]


Hi Hiro!

On 30 Jan, Hiroyuki Yamamoto wrote:
> On Sat, 26 Jan 2002 18:18:28 +0100 (CET)
> "Joachim F. Selinger" <selinger@bawue.de> wrote:
>> 1. Right now I have cronjob running that 'touch'es the inbox dir
>> every    minute and with that Sylpheed get's all new mail.
>> 2. I just checked that if I create a file in a dir or if I rename
>> one,    the 'ctime' of the dir does indeed change.
>> 
>> I'm not sure what the 'mtime' is, as my 'ls' can't show it. Is it
>> the same thing as the 'ctime'? If I know how to test this, i'll
>> happily do it. 
> From 'man 2 stat':
> 
>        The field st_mtime is changed by file modifications,  e.g.
>        by  mknod(2),  truncate(2), utime(2) and write(2) (of more
>        than zero bytes).  Moreover, st_mtime of  a  directory  is
>        changed  by  the  creation  or  deletion  of files in that
>        directory.  The st_mtime field is not changed for  changes
>        in owner, group, hard link count, or mode.
> 
>        The  field  st_ctime  is  changed by writing or by setting
>        inode information (i.e., owner, group, link  count,  mode,
>        etc.).

I found that two, but I couldn't find a way to persuade me 'ls' to show me
the mtime. ;-)
 
> You can see the mtime and other information if 'stat' command
> is installed.
> 
> Perhaps the way to handle mtime is somewhat different between ext2 and
> JFS. I assume JFS only updates ctime, not mtime when a file is created
> inside of a directory.

That is true, as my patch shows.
 
> Maybe using both mtime and ctime will a better solution. I'll check
> it.

I did it and that solves it. I found that only changing one place is
enough, but maybe this is not elegant, as it might update the mh folder
more often than necessary. Anyhow, here is my small patch that fixed it.

*** mh.c.orig   Mon Nov  5 02:48:34 2001
--- mh.c        Thu Jan 31 16:06:53 2002
***************
*** 72,78 ****
        if (stat(path, &s) < 0) {
                FILE_OP_ERROR(path, "stat");
        } else {
!               if (item->mtime == s.st_mtime) {
                        debug_print("Folder is not modified.\n");
                        scan_new = FALSE;
                } else
--- 72,78 ----
        if (stat(path, &s) < 0) {
                FILE_OP_ERROR(path, "stat");
        } else {
!               if ( (item->mtime == s.st_mtime) && (item->mtime == s.st_ctime)) {
                        debug_print("Folder is not modified.\n");
                        scan_new = FALSE;
                } else


Gruessle
Jocki
--
============================/\===/\=======/\============================
Joachim F. Selinger        /  \ /  \/\ /\/  \              ___
Brunhildenweg 4           /    \/\ /  \  \/\ \              |
D-70597 Stuttgart,Germany/     /  / CU \ /  \ \  ----------(0)----------
Tel.(49)+711-901-8040   /   ü /  /      /    \ \            '
Fax.(49)+711-901-8041==selinger(@)idefix.s.bawue.de======Soaring========

[Attachment #3 (APPLICATION/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic