Rename() broken again?

Stewart Greenhill sgreenhill@iprimus.com.au
Sun May 20 07:32:00 GMT 2001


Hi Folks,

I reported this problem under 1.1.2 and it was fixed for 1.1.3. It seems
that it may have returned...

Unix file semantics should allow open files to be renamed. If all is well,
the following code fragment should not return an error.

#include <stdio.h>

char * oldName = "test.file^";
char * newName = "test.file";

int main(int argc, char ** argv) {
        int result;
        FILE * f = fopen(oldName, "w");

        result = rename(oldName, newName);
        if (result != 0) {
                perror("Rename");
        } else {
                printf("OK!");
        }
        fclose(f);
}

I can verify that this works properly under cygwin 1.1.7 on Windows NT 4. A
user has reported problems under Windows 98 with the latest release of
cygwin. His system:
 OS: Win98se german
 File system: Fat32 6GB and 74GB on a 3x30GB RAID
 Cygwin: Downloaded from official site on 18.May.2001 (dll-ver 1.3.1)

His result with the above example:
  Rename: Permission denied

This breaks the OOC Oberon-2 compiler (ooc.sourceforge.net).

This seems to be a bug. Could someone please check what's happening here?

Cheers,
  Stewart

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list