Date: Thu, 2 Mar 2000 11:09:24 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Mariano Alvarez =?iso-8859-1?Q?Fern=E1ndez?= cc: "djgpp-workers AT delorie DOT com" Subject: Re: short file names when using LFN In-Reply-To: <38BD6169.BAFB42CE@teleline.es> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com Errors-To: dj-admin AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, 1 Mar 2000, Mariano Alvarez =?iso-8859-1?Q?Fern=E1ndez?= wrote: > > putenv ("LFN=n"); > > _truename (long_name, short_name); > > putenv ("LFN=y"); > > No, sorry, this don't work to get the real sfn of a file. Please post the details. The short test program attached below works for me. > > > Now, I only need the put routine :-) I'm playing with a crazy idea: > > > do the copy, compare the short filenames > > > if they don't match rename the copied file adding .00n > > > do another copy and try again > > > when the short filenames match, delete the bad copies. > > > I don't understand what are you trying to accomplish. Please > > explain. > > I mailed about this to the general list, I want a copy utility who take care > about sfn and lfn of each file. This is AFAIK impossible. But I still don't think I understand why do you think your idea should work. Are you assuming that Windows eventually runs out of the numeric tails and begins to reuse them? #include #include #include int main (int argc, char *argv[]) { char short_name[FILENAME_MAX]; const char *long_name = argc > 1 ? argv[1] : argv[0]; putenv ("LFN=n"); _truename (long_name, short_name); putenv ("LFN=y"); printf ("`%s' -> `%s'\n", long_name, short_name); return 0; }