This is the mail archive of the
cygwin@sources.redhat.com
mailing list for the Cygwin project.
Have rename() semantics changed?
- To: cygwin at sourceware dot cygnus dot com
- Subject: Have rename() semantics changed?
- From: Stewart Greenhill <greenhil at murdoch dot edu dot au>
- Date: Thu, 13 Jul 2000 11:57:06 +0800
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