Mail Archives: djgpp-workers/2000/12/31/13:59:11
> From: "Tim Van Holder" <tim DOT van DOT holder AT pandora DOT be>
> Date: Sun, 31 Dec 2000 16:42:15 +0100
>
> > 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.
Actually, `mv' tries to call `rename' first, and only if that fails,
it falls back on copy/remove.
> Below is a simple program that lowercases all file and directory
> names in the current dir. Does this work on WinME too?
As I wrote elsewhere, the problems which were reported on c.o.m.d. had
to do with the target of rename already existing.
> 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.
- Raw text -