Forum OpenACS Development: Re: NaviServer on Windows: [ns_logroll] returns "Permission denied"

Hi!

Just to let you know that the latest changes in NaviServer did not fix the ns_logroll issue. I can now execute, the command, but the result is not what is expected. Here is the output after executing "ns_logroll" a few times in the /ds/shell:

-rwxrwx---+ 1 Administratoren SYSTEM 2299588 26. Jun 22:52 error.log
-rwxrwx---+ 1 Administratoren SYSTEM 2216752 26. Jun 22:48 error.log.000
-rwxrwx---+ 1 Administratoren SYSTEM 2216752 26. Jun 22:48 error.log.001
-rwxrwx---+ 1 Administratoren SYSTEM 2216752 26. Jun 22:48 error.log.002
-rwxrwx---+ 1 Administratoren SYSTEM 2216752 26. Jun 22:48 error.log.003

ns_logroll seems to perform a copy operation. But it doesn't start over with an empty error.log...

Cheers,
Frank

Thank you Frank for spotting this.
I've just uploaded version 3.3.2 of my installer/distribution that should fix it:

static int
Rename(const char *from, const char *to)
{
int err;
Tcl_Obj *fromObj, *toObj;

NS_NONNULL_ASSERT(from != NULL);
NS_NONNULL_ASSERT(to != NULL);

fromObj = Tcl_NewStringObj(from, -1);
Tcl_IncrRefCount(fromObj);

toObj = Tcl_NewStringObj(to, -1);
Tcl_IncrRefCount(toObj);

#ifdef WIN32
err != CopyFile(from, to, FALSE);
if (err == 0) {
File * fw = (FILE *)NULL;
if ((fw = fopen(from, "w")) != (FILE *)NULL) {
fprintf(fw, "");
fflush(fw);
fclose(fw);
}
}
#else
err = Tcl_FSRenameFile(fromObj, toObj);
#endif
Tcl_DecrRefCount(fromObj);
Tcl_DecrRefCount(toObj);
if (err != 0) {
Ns_Log(Error, "rollfile: failed to rename file '%s' to '%s': '%s'",
from, to, strerror(Tcl_GetErrno()));
}

return err;
}

Thank you,
Maurizio

Dear Frank, could you double check that in your config you have

ns_param logroll on

?

TIA,
Maurizio