From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Evgeny Zajcev Newsgroups: gmane.emacs.devel Subject: file-exists-p on empty string Date: Wed, 27 Feb 2019 15:29:53 +0300 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000523b530582df5582" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="148722"; mail-complaints-to="usenet@blaine.gmane.org" To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 27 15:01:54 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 1gyzmS-000cKC-6r for ged-emacs-devel@m.gmane.org; Wed, 27 Feb 2019 15:01:52 +0100 Original-Received: from localhost ([127.0.0.1]:44252 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyzmR-0002ue-5h for ged-emacs-devel@m.gmane.org; Wed, 27 Feb 2019 09:01:51 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:51653) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyzV2-0005jH-HC for emacs-devel@gnu.org; Wed, 27 Feb 2019 08:43:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gyzFv-0002KB-8v for emacs-devel@gnu.org; Wed, 27 Feb 2019 08:28:17 -0500 Original-Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]:44434) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gyzFr-00026n-Bg for emacs-devel@gnu.org; Wed, 27 Feb 2019 08:28:13 -0500 Original-Received: by mail-lf1-x134.google.com with SMTP id v185so1093633lfa.11 for ; Wed, 27 Feb 2019 05:27:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=nmZXf2EYCaqS0p60y0cJdEB44n3W0bYEOnD46ldMi7Y=; b=DkUBYl4jASjwszgxm3GfCnll87d0JlJYkhtdvXcgczE3Za/FhG/TR6fQGN7Qs6gMuF EW7xenCGOoYVQersm1Se7G1Cu7PfFlZzS6kusNxj/poPJ9AzPMTJ/BPZxHlLGf39orhv iCQaoxz3ah1/h0z5+ZDDSL2rcWtqnumUF6sV/Jo3VMLmwR25HZWEvs0J2+uz8GXZtMHK PBenMaIp/K9KS/BIP5jUcZ0La1WqQ+Dj5/78FQwsspd5MfISuaIWgkHZShdRQzXN+/ZZ A5B0G4hakwD+7hREwILx02bAhoUy6f8Yk+gGysktSzymPlsc6z4ht5NXbujSPPbpals6 XamQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=nmZXf2EYCaqS0p60y0cJdEB44n3W0bYEOnD46ldMi7Y=; b=sHTEyXT6ocX0D0MIG9RkZocdQgPXcbXEvkY8jRrDLyVGU1WSbkrB7W5CW5ftB3Uu92 91pfNyirRgmBm39241rSUa9dJsdAyc5fd/PNbL4GFvAQfkRRJ3kLOmCBe+SqelzjOL1Q UhFJ0aCAGsxPldOG4+f7qyoFwahgcoXTW1E1WTTqNKtdb5Tc9Q0RYNNaoTY2/ScPKrhT mkIDhwQMzyodFaGtvy/ILroIBzwwjo85G/aNrDd35WMnowO68iwKaDdK6u4QRzUA+ON5 pEVpMKaJXV0yZ+JR+BY2yB9zcfw7UOPs4bPQk+pPsMB7+r2XHQ0xKFwfO4JWH6W93ZlK oYNA== X-Gm-Message-State: AHQUAubAOvioaysUJitkmtVSXZeE118UbbA0umLCLYrTDKmGqVwTlkgv jtzwiOa9JCiT6IIIaMynKlyYfY4oMxdaY9UVEwHSMOar X-Google-Smtp-Source: AHgI3Ian8nlOtFG6XOFZATFlfhkJzB6N7aM7loMhm4o/ztSM6VXhTqjF3kTnDi6TGUbuuvp2b81lpuAqqFq1+8SGQ4Q= X-Received: by 2002:a19:8c56:: with SMTP id i22mr735727lfj.79.1551270604321; Wed, 27 Feb 2019 04:30:04 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::134 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:233645 Archived-At: --000000000000523b530582df5582 Content-Type: text/plain; charset="UTF-8" It was quite surprising for me that (file-exists-p "") ==> t I thought that `file-exists-p` resembles stat, such as $ 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? Thanks -- lg --000000000000523b530582df5582 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
It= was quite surprising for me that

=C2=A0 (file-exi= sts-p "")
=C2=A0 =3D=3D> t

= I thought that `file-exists-p` resembles stat, such as
=C2=A0=C2= =A0
=C2=A0 $ stat ""
=C2=A0 No such file or d= irectory

This is because `file-exists-p` uses `exp= and-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 &= quot;." as filename?

Thanks

--
lg
--000000000000523b530582df5582--