emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nnmaildir.el


From: Reiner Steib
Subject: Re: nnmaildir.el
Date: Sat, 18 Jul 2009 13:13:37 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.1 (gnu/linux)

On Sat, Jul 18 2009, Eli Zaretskii wrote:

> Is nnmaildir.el supposed to work on non-Posix platforms?
>
> If it is, then it should not unconditionally invoke Unix-only
> functions such as unix-sync.

Since Maildir (the underlying mail storage format) is not suitable for
Windows, nnmaildir.el is Posix-only.  CMIIW.

- colons in filenames; no specification about replacement charater

  (BTW, what does Samba do when `:' is used on a share?)

  nnmaildir.el could avoid hard-coding `:', though.

- no atomic rename on Windows

- (no hard links on ntfs, at least not for non-administrative users)

See <http://en.wikipedia.org/wiki/Maildir#Windows_software>.

> If it isn't supposed to work on anything but Unix and GNU systems, how
> about disabling to load it on others, or at least printing a warning?

I think a warning should be sufficient.  Maybe even only when calling
`unix-sync'.  See the attached patch.

BTW, when discussing Gnus issues, please cc <address@hidden>.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/
--- nnmaildir.el        19 May 2008 10:47:42 +0200      7.20
+++ nnmaildir.el        18 Jul 2009 13:09:43 +0200      
@@ -152,6 +152,12 @@
   (gnm          nil)                      ;; flag: split from mail-sources?
   (target-prefix nil :type string))        ;; symlink target prefix
 
+(defun nnmaildir--sync ()
+  (if (fboundp 'unix-sync)
+      (unix-sync) ;; no fsync :(
+    (gnus-message
+     1 "nnmaildir: `unix-sync' not supported on this platform.")))
+
 (defun nnmaildir--expired-article (group article)
   (setf (nnmaildir--art-nov article) nil)
   (let ((flist  (nnmaildir--grp-flist group))
@@ -1293,7 +1299,7 @@
        (set-buffer buffer)
        (gmm-write-region (point-min) (point-max) tmpfile nil 'no-message nil
                          'excl))
-      (unix-sync) ;; no fsync :(
+      (nnmaildir--sync) ;; no fsync :(
       (rename-file tmpfile (concat (nnmaildir--cur dir) file suffix) 'replace)
       t)))
 
@@ -1387,7 +1393,7 @@
        (error
         (gmm-write-region (point-min) (point-max) tmpfile nil 'no-message nil
                           'excl)
-        (unix-sync))) ;; no fsync :(
+        (nnmaildir--sync))) ;; no fsync :(
       (nnheader-cancel-timer 24h)
       (condition-case err
          (add-name-to-file tmpfile curfile)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]