delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/06/27/14:25:25

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:date:message-id:references
:mime-version:content-type:content-transfer-encoding; q=dns; s=
default; b=uSPEYopgb22CRNju07Ut9vnrEOV/2ch9u1x2wkN7ia4ZBu6B6sAxY
vijEDidqDkK6/DFTN2HESjuJrTSyj+d7bm2PT6Cz7sh/826pPqUOlNOh4oUU0FY9
IXnnNBn+ZYyWdvR5yGsYB044Ip4Sm2HaiG+3DjALcuOBshNJp6sn88=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:date:message-id:references
:mime-version:content-type:content-transfer-encoding; s=default;
bh=yx2pW4o7QJZ+en7RBa6/ryW0Iiw=; b=rNq7M8YmoZMZSiOCX5ovOnoidvjg
Rx9Wku4BtHtpLfHFK8k3vDAXcZrYbk/FCPxNLLxYFyvlRNpO+MUKHR2jq1Hf9wty
AguW5C1bIkUtcW7ifp+y2bI203bkFD05zhizItzbHyiJf9UbsXIiZ6fp0/iEGySU
4YEuBO9JkNvdrp8=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=BAYES_00,DATE_IN_PAST_12_24,FSL_HELO_BARE_IP_2,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_NUMERIC_HELO,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.1
To: cygwin AT cygwin DOT com
From: g <ggrimes AT nc DOT rr DOT com>
Subject: Re: where was mention of what creates NUL files?
Date: Wed, 26 Jun 2013 18:53:21 +0000 (UTC)
Lines: 41
Message-ID: <loom.20130626T202645-269@post.gmane.org>
References: <4C93A171 DOT 4040402 AT fgm DOT com>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)



Daniel Barclay <daniel <at> fgm.com> writes:

> 
> Does anyone recall a mention of what in CygWin (or possibly Emacs) creates
> files with a simple name of "NUL"?
> 
> Thanks,
> Daniel
> 
> 


This has been driving me nuts for years. Finally tracked it down.
These are created by emacs' man.el code when you get a man page.
Reproduce: 
In emacs, do:
    M-x man <ret>
    <enter anything, valid ('ls') or not>
Now, you'll see a NUL file in the directory.

Root cause:
construction of the 'man' command that is passed to the shell includes:
(concat " %s 2>" null-device)

The variable `null-device' is platform specific and defaults to a pure-copy
of "/dev/null" which, apparently, becomes "NUL" on windows.

It is a defvar in files.el and 'set' again in dos-w32.el.

Resolution:
In your .emacs file, do:

   (require 'dos-w32) ;; load this first to avoid it undo'ing the next line
   (setq null-device "c:/tmp/emacs-dev-null.txt") ;; set to anything

Happy days!




--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019