www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/05/09:08:44

Date: Tue, 5 May 1998 16:06:41 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "Salvador Eduardo Tropea (SET)" <salvador AT inti DOT gov DOT ar>
cc: djgpp AT delorie DOT com
Subject: Re: fixpath problem in Novell drives.
In-Reply-To: <m0yWgfW-000S3nC@inti.gov.ar>
Message-ID: <Pine.SUN.3.91.980505155418.28653B-100000@is>
MIME-Version: 1.0

On Tue, 5 May 1998, Salvador Eduardo Tropea (SET) wrote:

> Suppose the user enters it in the save window: c:\long_name.txtt
> and I'm in a non LFN system, when I pass it to fopen it works OK and creates a 
> file long_nam.txt. The user sees in the window caption the fake name (the one 
> he specified).

Oh, I see.  Sure, this problem happens in Emacs as well, and there are a 
couple of user options to handle it.

First, depending on the point of view, this can be a feature: sometimes 
it is actually good to have the editor obey the name the user types.  For 
example, if the editor enters a special editing mode given the file's 
extension, then e.g. "foo.java" will correctly invoke the Java mode even 
though the file is actually called "foo.jav" on DOS.  So it is not 
necessarily bad that the file name editor thinks is being edited is 
different from the actual name.  This situation is the default in Emacs, 
and I find it quite reasonable.  Given that the editor itself can know 
(using `stat') that two files are actually the same file, it is only a 
matter of user preference.  If the user tries to open the same file under 
a different name, you just tell them that the file is already open under 
the other name and don't let them open it again.

Then there's a possibility that the user would like to actually see the 
true name of the file.  For that, you indeed need to use _truename.  I 
don't think displaying the name _truename returns is bad in this case: 
after all, that's what the user wanted.  You could down-case it when LFN 
is off, but what's wrong with backslashes?

Btw, Emacs also has an option to let the user open the same file more 
than once under different names, if the user wants.  Emacs can tolerate 
this because it doesn't keep the file open: once it is read into memory, 
it is closed.

- Raw text -


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