all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* nnmaildir.el
@ 2009-07-18  9:40 Eli Zaretskii
  2009-07-18 11:13 ` nnmaildir.el Reiner Steib
  0 siblings, 1 reply; 2+ messages in thread
From: Eli Zaretskii @ 2009-07-18  9:40 UTC (permalink / raw)
  To: emacs-devel

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.

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?




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: nnmaildir.el
  2009-07-18  9:40 nnmaildir.el Eli Zaretskii
@ 2009-07-18 11:13 ` Reiner Steib
  0 siblings, 0 replies; 2+ messages 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] 2+ messages in thread

end of thread, other threads:[~2009-07-18 11:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-18  9:40 nnmaildir.el Eli Zaretskii
2009-07-18 11:13 ` nnmaildir.el Reiner Steib

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.