delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/06/15:29:50

From: Hans-Bernhard Broeker <broeker AT acp3bf DOT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: What is the canonical way to find out if a file exists (in g++)?
Date: 6 Jan 2000 16:53:43 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 29
Message-ID: <852han$i4m$1@nets3.rz.RWTH-Aachen.DE>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1000106122148 DOT 20220V-100000 AT is> <slrn879fsi DOT 3vvqds3 DOT mad AT asylum DOT fasttrack DOT net>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 947177623 18582 137.226.32.75 (6 Jan 2000 16:53:43 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 6 Jan 2000 16:53:43 GMT
User-Agent: tin/1.4-19991113 ("No Labels") (UNIX) (Linux/2.0.0 (i586))
Originator: broeker@
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Mike Demoulin <mad AT intersurf DOT com> wrote:
> On Thu, 6 Jan 2000 12:22:12 +0200 (IST),
>     Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote:
>>
>>If you are looking for a long file name on NT, DJGPP programs won't
>>find it.  Try "dir /x" and look for the short 8+3 alias: that's all
>>DJGPP programs are allowed to see on NT.

> Is there a function to convert from an LFN to its 8+3 alias (without using
> the dir/x)?

No, at least not a general one. The short alias is chosen at file
creation time, based on the long name, and on what other short names
are already present in the same directory. That makes the short name
essentially random. Without accessing the actual LFN file, there's not
the slightest chance you'll ever know for sure which of the
short-named files corresponds to it.

Which is the major reason many have called the whole concept of 8+3
alias names brain-damaged. A single file having 2 partly independent
names, one of which can change randomly behind your back, in certain
situations, is a major pain in the lower back, at times. It might have
been better to just hide all non-8.3 names from DOS programs, right
away...


-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


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