This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Have rename() semantics changed?


Hi,

The latest cygwin seems not to allow open files to be renamed. This
works under Unix. It is not normally allowed under Windows, but worked
in previous versions of the cygwin environment.

Is this an official change, or could it be a bug?

I noticed this because it broke the OOC Oberon-2 compiler
(ooc.sourgeforge.net) under cygwin. The following code snippet
demonstrates the problem.

#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);
}

The latest cygwin (1.1.2) now returns an error 13 (permission denied).

Cheers,
  - Stewart

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]