From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: Null filename ("") is considered to correspond to an existing, readable, and writable file? Date: Mon, 2 Jan 2006 14:57:18 -0800 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1136242668 22867 80.91.229.2 (2 Jan 2006 22:57:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 2 Jan 2006 22:57:48 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 02 23:57:45 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EtYcY-0005iu-4E for ged-emacs-devel@m.gmane.org; Mon, 02 Jan 2006 23:57:42 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EtYe9-000884-05 for ged-emacs-devel@m.gmane.org; Mon, 02 Jan 2006 17:59:21 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EtYdy-00087y-6j for emacs-devel@gnu.org; Mon, 02 Jan 2006 17:59:10 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EtYdt-00087m-Fv for emacs-devel@gnu.org; Mon, 02 Jan 2006 17:59:09 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EtYdt-00087j-Cg for emacs-devel@gnu.org; Mon, 02 Jan 2006 17:59:05 -0500 Original-Received: from [141.146.126.228] (helo=agminet01.oracle.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1EtYf0-0003dd-TW for emacs-devel@gnu.org; Mon, 02 Jan 2006 18:00:15 -0500 Original-Received: from rgmsgw300.us.oracle.com (rgmsgw300.us.oracle.com [138.1.186.49]) by agminet01.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id k02MvJFJ016117 for ; Mon, 2 Jan 2006 16:57:19 -0600 Original-Received: from rgmsgw300.us.oracle.com (localhost [127.0.0.1]) by rgmsgw300.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id k02MvIcn029999 for ; Mon, 2 Jan 2006 15:57:18 -0700 Original-Received: from dradamslap (dhcp-amer-rmdc-csvpn-gw5-141-144-104-171.vpn.oracle.com [141.144.104.171]) by rgmsgw300.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with SMTP id k02MvIMj029989 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Mon, 2 Jan 2006 15:57:18 -0700 Original-To: "Emacs-Devel" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:48635 Archived-At: The following expressions all return true (on Windows, at least). I imagine that this is by design (it is an old policy), but I don't understand the reason for this. (file-exists-p "") (file-readable-p "") (file-writable-p "") How often would someone want a null filename to be considered to correspond to an existing, readable, or writable file? This means that code that tests a filename needs to do something like this: (and (not (string= "" name)) (file-readable-p name)) For example, when prompting a user for the name of a readable file, I guess you need to do something like this: (while (or (string= "" name) (not (file-readable-p name))) (setq name (read-file-name prompt...))) Why? This behavior also seems to contradict the doc strings. They say clearly that the file with the given name really exists, is really readable, or is really writable. Also, the doc strings and the manual say nothing about using a default directory (yes, apparently) or whether the FILENAME argument must include a directory (it need not, apparently).