www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/08/26/09:55:00

Date: Tue, 26 Aug 1997 16:50:47 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: djgpp-workers AT delorie DOT com
Subject: `rename' under LFN
Message-ID: <Pine.SUN.3.91.970826164008.6086E-100000@is>
MIME-Version: 1.0

Here's a nasty one: `rename' fails for directories on LFN platforms.  You 
can try "mv -v xyzzy abcdf" where xyzzy is a directory and abcdf doesn't 
exist, and see it fail when LFN=y, succeed when LFN=n.

It turns out this is due to `_truename' (so what else is new?).  Under 
LFN, it calls Int 21h/AX=7160h/CX=2.  But this call is documented to fail 
when the named file does not exist, because it might need to return a 
long name when you call it with a short name.  And `rename' needs to call 
`_truename' so it won't rename foo to foo/bar.

The following patch makes `_truename' try once more but with CX=0 if the 
call with CX=2 fails.  This does not validate the file and so works in 
these cases, and the problem of getting the long name doesn't exist for a 
non-existing file.

I've uploaded to DJ's /incoming a version of fil316b.zip linked with the 
patched `_truename', it should be on SimTel.NET shortly.  If you work on 
Windows 95, you will probably want it.

- Raw text -


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