Gnus development mailing list
 help / color / mirror / Atom feed
* Re: nnmaildir.el
       [not found] <831voeqqh9.fsf@gnu.org>
@ 2009-07-18 11:13 ` Reiner Steib
  0 siblings, 0 replies; only message in thread
From: Reiner Steib @ 2009-07-18 11:13 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel, ding, Paul Jarc

[-- Attachment #1: Type: text/plain, Size: 1089 bytes --]

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 <ding@gnus.org>.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1169 bytes --]

--- 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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-07-18 11:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <831voeqqh9.fsf@gnu.org>
2009-07-18 11:13 ` nnmaildir.el Reiner Steib

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).