delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/10/22/17:19:08

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
Message-ID: <435AACBF.288A46BE@dessent.net>
Date: Sat, 22 Oct 2005 14:18:55 -0700
From: Brian Dessent <brian AT dessent DOT net>
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: When are Windows Short Path Names required
References: <gf4ll19t24s5el791n26rudlum24i066ot AT 4ax DOT com>
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com

zzapper wrote:

> $ cygpath -d c:/Program\ Files/Internet\ Explorer
> c:\PROGRA~1\INTERN~1
> 
> I've just had another case where the I had to use the short form, is the short form the "real name"?

Huh?  What do you mean?  Does the short form uniquely identify the
file?  Yes, of course.  But only in that particular instance. 
"progra~1" does not necessarily always map to "Program Files".  For
example if you created "Program Data" and then later created "Program
Files", you would have "progra~1" and "progra~2".  So you can not and
should not blindly assume that a certain short name will always map to a
given long name.  It's a one-way thing.  Even storing a short name (such
as in the registry or a config file) and then later referring to that
file is not safe, since the ~1 mapping might have changed.  (Many, many
programs make this mistake still.)

Generation of the short name from the long name is not even not
guaranteed to exist or work.  You can turn off 8.3 filename generation
on NTFS volumes, which means that the short form no longer works.

In other words, 8.3 filenames are a hideous hack that no one should be
using in this day and age.  Fix the quoting problem instead.

Brian

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

- Raw text -


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