From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.devel Subject: Re: file-exists-p on empty string Date: Wed, 27 Feb 2019 16:43:29 +0100 Message-ID: References: <87pnrde2rm.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="75172"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Evgeny Zajcev , emacs-devel To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 27 16:44:30 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gz1Nm-000JS0-5a for ged-emacs-devel@m.gmane.org; Wed, 27 Feb 2019 16:44:30 +0100 Original-Received: from localhost ([127.0.0.1]:46262 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gz1Nl-00023L-2j for ged-emacs-devel@m.gmane.org; Wed, 27 Feb 2019 10:44:29 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gz1Na-00022H-Iz for emacs-devel@gnu.org; Wed, 27 Feb 2019 10:44:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gz1NY-0008Ml-Kd for emacs-devel@gnu.org; Wed, 27 Feb 2019 10:44:18 -0500 Original-Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:32997) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gz1NY-00089S-AG for emacs-devel@gnu.org; Wed, 27 Feb 2019 10:44:16 -0500 Original-Received: by mail-wm1-x32b.google.com with SMTP id c13so4694178wmb.0 for ; Wed, 27 Feb 2019 07:43:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:mail-followup-to:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:mime-version :content-transfer-encoding; bh=kDGRKHcPOXXajM3uzktHKs6dhCxXDuBJpzPzj2uF+Ek=; b=Sugo/PGDpJ0P9Q4pFZRgHx5f1QNFMU4TKv6mvwvJIfCVHP2oo33rPd8UXnbe3Lw7bZ t2E8097Fpbd0mFlaYe2kBIfU81o65SNHToFLXu8rkn3yMWG9Zw4KYJ6R2CqXLl0PkB7t ZL6b4T0bhcMkR3TYyNOP9Ko8HKc70NNkvz/x/SNrW1RNv3c5sRZ4Xjcd4RxcyiyZ6m/+ VhLpery2PB5fz9PZFOnHK0IKDlZXJeJbLQBrBr5gDMl0QPF2wBUYiJVsgspTE9Qfz9f0 8N2NkLRBuJleSc1BADurckGJYhz3DV21TXYwNVrcBz1422SVRu3SLBsi3T5LOPUCIQy0 do5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:mail-followup-to :mail-copies-to:gmane-reply-to-list:date:in-reply-to:message-id :mime-version:content-transfer-encoding; bh=kDGRKHcPOXXajM3uzktHKs6dhCxXDuBJpzPzj2uF+Ek=; b=T6cPRvywvdjxExWkZC5NSD5RHu3hYa+c0IE3Srws24KrA6fbomh9qBdjLBQ3x5blre 9MfmrO7pEHBZc1UEk4lhSCoDs+SuW8oZ11xVRHCfEuWZmYy9jrGMogCqjDSkSTD7RwVD jj28+IkYhbXYWnNVVZ3Fv3oVarvLA3Ytc9ZLS3yNRbS9sXvPuJ10/fOFBX0AQPiTFXee Lno8IJvw6nvuPXFQq3LS0avwLZ28egKzlBCUVQFjpj0WmDK6a9a53rD3HzcUjimc/8DD 2K6H/RkDpcaWc1rUpz7oe1mC8d2iruAR5cN+CtywYz9OBW6PphC3Va+aSBV25X5CX4xU ssxg== X-Gm-Message-State: AHQUAubR7YEb1U0QoZV71J6+7c60s5kCWrwkytuTMXxMZMDACJg+1/Av rMeu92ECWbK98dKXHMc8zaQC+eTD X-Google-Smtp-Source: AHgI3IaVAw3KzAFmMEEtaw8mIi8hi74COMwIyFn3E2ByBOS0osdVIl6xbdYvfdmff4b2eCBX6ekk8w== X-Received: by 2002:a05:600c:210b:: with SMTP id u11mr2719665wml.11.1551282211678; Wed, 27 Feb 2019 07:43:31 -0800 (PST) Original-Received: from rpluim-mac ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id c17sm9759023wrs.17.2019.02.27.07.43.30 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 27 Feb 2019 07:43:30 -0800 (PST) Mail-Followup-To: emacs-devel@gnu.org Mail-Copies-To: never Gmane-Reply-To-List: yes In-Reply-To: <87pnrde2rm.fsf@gmx.de> (Michael Albinus's message of "Wed, 27 Feb 2019 15:15:25 +0100") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32b X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:233650 Archived-At: Michael Albinus writes: > Evgeny Zajcev writes: > > Hi Evgeny, > >> It was quite surprising for me that >> >> (file-exists-p "") >> =3D=3D> t >> >> I thought that `file-exists-p` resembles stat, such as >>=20=20=20 >> $ stat "" >> No such file or directory >> >> This is because `file-exists-p` uses `expand-file-name`, which returns >> current directory for empty string >> >> Would not it be more correct for `file-exists-p` to return `nil` for >> empty string, and if someone wants current directory he will use "." >> as filename? > > I believe the current behavior is correct. file-exists-p calls > expand-file-name, and (expand-file-name "") returns always > default-directory. That=CA=BCs not described in the doc-string though, so it=CA=BCs surprising behaviour. Robert