1 Return-Path: <gmn-notmuch@m.gmane.org>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 50FAA431FBC
\r
6 for <notmuch@notmuchmail.org>; Thu, 14 Jan 2010 23:30:30 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-2.035 tagged_above=-999 required=5 tests=[AWL=0.564,
\r
12 BAYES_00=-2.599] autolearn=ham
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id cjvKTo2fkDwx for <notmuch@notmuchmail.org>;
\r
16 Thu, 14 Jan 2010 23:30:28 -0800 (PST)
\r
17 Received: from lo.gmane.org (lo.gmane.org [80.91.229.12])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 75A89431FAE
\r
19 for <notmuch@notmuchmail.org>; Thu, 14 Jan 2010 23:30:28 -0800 (PST)
\r
20 Received: from list by lo.gmane.org with local (Exim 4.50) id 1NVgdW-0005Xk-5m
\r
21 for notmuch@notmuchmail.org; Fri, 15 Jan 2010 08:30:26 +0100
\r
22 Received: from ip-118-90-138-203.xdsl.xnet.co.nz ([118.90.138.203])
\r
23 by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
\r
25 for <notmuch@notmuchmail.org>; Fri, 15 Jan 2010 08:30:26 +0100
\r
26 Received: from olly by ip-118-90-138-203.xdsl.xnet.co.nz with local (Gmexim
\r
27 0.1 (Debian)) id 1AlnuQ-0007hv-00
\r
28 for <notmuch@notmuchmail.org>; Fri, 15 Jan 2010 08:30:26 +0100
\r
29 X-Injected-Via-Gmane: http://gmane.org/
\r
30 To: notmuch@notmuchmail.org
\r
31 From: Olly Betts <olly@survex.com>
\r
32 Date: Fri, 15 Jan 2010 07:30:04 +0000 (UTC)
\r
34 Message-ID: <slrnhl06bt.2rf.olly@msgid.survex.com>
\r
35 References: <4B4ED7E8.20501@exys.org> <878wc0623y.fsf@exys.org>
\r
36 <20100114183854.1d04f111@hikari> <87fx68e2am.fsf@yoom.home.cworth.org>
\r
37 <slrnhkvo6d.2rf.olly@msgid.survex.com>
\r
38 <878wbzx3td.wl%djcb@djcbsoftware.nl>
\r
39 X-Complaints-To: usenet@ger.gmane.org
\r
40 X-Gmane-NNTP-Posting-Host: ip-118-90-138-203.xdsl.xnet.co.nz
\r
41 User-Agent: slrn/pre1.0.0-11 (Linux)
\r
42 Sender: news <news@ger.gmane.org>
\r
43 Subject: Re: [notmuch] indexing mail?
\r
44 X-BeenThere: notmuch@notmuchmail.org
\r
45 X-Mailman-Version: 2.1.13
\r
47 List-Id: "Use and development of the notmuch mail system."
\r
48 <notmuch.notmuchmail.org>
\r
49 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
50 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
51 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
52 List-Post: <mailto:notmuch@notmuchmail.org>
\r
53 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
54 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
55 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
56 X-List-Received-Date: Fri, 15 Jan 2010 07:30:30 -0000
\r
58 On 2010-01-15, Dirk-Jan C Binnema wrote:
\r
59 >>>>>> "Olly" == Olly Betts <olly@survex.com> writes:
\r
60 > Olly> Not a full patch, but I already posted what this code should look like
\r
61 > Olly> to handle both systems without d_type, and those which return DT_UNKNOWN:
\r
63 > Olly> http://article.gmane.org/gmane.mail.notmuch.general/1044
\r
66 > _set_dtype (const char* path, struct dirent *entry)
\r
68 Underscore prefixed identifiers are reserved by ISO C at file-scope; using them
\r
69 yourself is undefined behaviour...
\r
71 > /* we only care about dirs, regular files and links */
\r
72 > if (S_ISREG (statbuf.st_mode))
\r
73 > entry->d_type = DT_REG;
\r
74 > else if (S_ISDIR (statbuf.st_mode))
\r
75 > entry->d_type = DT_DIR;
\r
76 > else if (S_ISLNK (statbuf.st_mode))
\r
77 > entry->d_type = DT_LNK;
\r
79 This addresses the case where the FS returns DT_UNKNOWN for d_type, but doesn't
\r
80 deal with the case of platforms where struct dirent has no d_type member - from
\r
81 the Linux readdir man page:
\r
83 The only fields in the dirent structure that are mandated by POSIX.1 are:
\r
84 d_name[], of unspecified size, with at most NAME_MAX characters preceding
\r
85 the terminating null byte; and (as an XSI extension) d_ino. The other fields
\r
86 are unstandardized, and not present on all systems; see NOTES below for some
\r
91 Other than Linux, the d_type field is available mainly only on BSD systems.
\r