From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: expand-file-name, DOS/Windows, and directory separator Date: Tue, 15 Feb 2022 21:15:13 +0200 Message-ID: <83r1842b7i.fsf@gnu.org> References: <87czjodn8m.fsf@ericabrahamsen.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9168"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eric Abrahamsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Feb 15 20:31:36 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nK3Xz-0002E0-Ue for ged-emacs-devel@m.gmane-mx.org; Tue, 15 Feb 2022 20:31:36 +0100 Original-Received: from localhost ([::1]:45758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nK3Xx-0002yR-Oo for ged-emacs-devel@m.gmane-mx.org; Tue, 15 Feb 2022 14:31:35 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nK3I6-00048g-Ir for emacs-devel@gnu.org; Tue, 15 Feb 2022 14:15:10 -0500 Original-Received: from [2001:470:142:3::e] (port=35662 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nK3I6-0004aY-65; Tue, 15 Feb 2022 14:15:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=8fZN4JdsdOEBiFWcStanak0t7r5/ngM90C15eSE2P3A=; b=JnhyzrXEGuCv xHgHA2DeZmfvMYrAEAPyzYhx7+kyAWA7DOIWMhQl4aA4Ch4lPGv3c1TYNazU4CqgliyA815U+nYh6 c58Ej8zeqx2r6Ptf+qFGMIkYZvxtBTh2d+5ED07fBrefcT3O7uJCvlL8jbOCvlTV4u3LgNNn8xC2e +ei77qQk/X+dlnO7llGeSfZapBZ68rSb1nIAd8qTb7egjGHVUPC5UiJO9jNpNy2khKehACbgimvSq L/e9DkViaNHp96VxS91mgbM5+VIfVgVYJkKVdd58Z9SgnkKAmK0Q0t+se2EKmaJLF004R/G2p6sK6 wTkFyR6CqW4BYEDahxyLag==; Original-Received: from [87.69.77.57] (port=3960 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nK3I5-0006M5-Ld; Tue, 15 Feb 2022 14:15:09 -0500 In-Reply-To: <87czjodn8m.fsf@ericabrahamsen.net> (message from Eric Abrahamsen on Tue, 15 Feb 2022 09:59:53 -0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:286345 Archived-At: > From: Eric Abrahamsen > Date: Tue, 15 Feb 2022 09:59:53 -0800 > > My reading of `expand-file-name' (I don't really speak C) is that, if we > run it over a file path produced by an external process on a Windows > machine -- meaning path strings where the directory separator might be a > backward slash -- it will normalize that separator to a unix-style > forward slash. It looks like fileio.c:1247 calls dostounix_filename, and > I'm assuming that's what that does. > > Is that a correct assumption? Yes. > Can I rely on that behavior? I'd rather you didn't. Why do you need such an assumption? Emacs on Windows can cope with file names that use any style of slashes.