From: "Tim Van Holder" To: Subject: RE: DOZE and WINDOZE versions Date: Sun, 31 Dec 2000 16:42:15 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-reply-to: <200012311446.PAA18462@father.ludd.luth.se> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Importance: Normal Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id KAA21664 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 Precedence: bulk > I've tried running "mv a b" with success. Doesn't mv use rename()? No; IIRC, it is basically a cp followed by an rm, code-wise. Then again, it's been a while since I fiddled with fileutils, so I may be wrong. Below is a simple program that lowercases all file and directory names in the current dir. Does this work on WinME too? Make sure you try it in a variety of places (network drives, dirs with LFN files, SUBSTed drives, ...). == start of simple proglet #include #include #include #include int __opendir_flags = __OPENDIR_PRESERVE_CASE; void decapitate(const char* name) { static char lowername[512]; /* Don't change a CVS directory */ if (strcasecmp (name, "CVS") == 0) return; strcpy (lowername, name); strlwr (lowername); if (strcmp (name, lowername) != 0) { printf ("%s -> %s\n", name, lowername); if (rename (name, lowername) != 0) { perror (name); } } } int main(void) { DIR* dp = NULL; struct dirent* ep = NULL; dp = opendir ("./"); if (dp != NULL) { while ((ep = readdir (dp)) != NULL) decapitate (ep->d_name); (void) closedir (dp); } else puts ("Couldn't open the directory."); return 0; }