delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/12/31/14:19:10

From: "Tim Van Holder" <tim DOT van DOT holder AT pandora DOT be>
To: <djgpp-workers AT delorie DOT com>
Subject: RE: DOZE and WINDOZE versions
Date: Sun, 31 Dec 2000 20:23:08 +0100
Message-ID: <NEBBIOJNGMKPNOBKHCGHOECPCAAA.tim.van.holder@pandora.be>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
In-reply-to: <1225-Sun31Dec2000205652+0200-eliz@is.elta.co.il>
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Importance: Normal
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id OAA32194
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> >   strcpy (lowername, name);
> >   strlwr (lowername);
> >   if (strcmp (name, lowername) != 0) {
> >     printf ("%s -> %s\n", name, lowername);
> >     if (rename (name, lowername) != 0) {
> This is not supposed to work with stock v2.03.  I only committed
> yesterday the changes that make this work, so before that, even the
> CVS version won't DTRT.
I'll admit that this particular code was taken from a tool written for
Linux (except for the added __opendir_flags). And, upon testing, it
indeed doesn't work.
But I've been using a similar tool (relevant snippet below) since 1998,
and it has always worked just fine, so I had no reason to think it
wouldn't work. Guess it matters that below, both args to rename() are
lowercase.

== snippet start
DIR *d = opendir(".");
struct dirent *de;
  while (de = readdir(d))
  {
    if (DirsToo || (access(de->d_name, D_OK)))
      rename (de->d_name, strlwr(de->d_name));
  }
== end snippet

- Raw text -


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