[IPython-dev] Re: Re: Re: Windows fixes, new prompts in CVS, testers?
Fernando Perez
Fernando.Perez at colorado.edu
Fri Jun 11 13:34:46 EDT 2004
Gary Bishop wrote:
> Could it be the permissions on the file as created by cygwin? I've had
> occasional problems with permissions resulting from using both.
> gb
Thorsten, do you have a feel for whether this could be the problem? I really
don't understand why it doesn't work. Here's the code:
if self.LOGMODE == 'backup':
if os.path.isfile(self.logfname):
backup_logname = self.logfname+'~'
# Manually remove any old backup, since os.remove may fail
# under Windows.
if os.path.isfile(backup_logname):
os.remove(backup_logname)
os.rename(self.logfname,backup_logname)
self.logfile = open(self.logfname,'w')
It _manually_ does the file removal of the backup first, before attempting the
rename operation. If this doesn't work, I simply don't know what else one can
do to force windows to delete the backup and rename the current file as backup.
Cheers,
f
More information about the IPython-dev
mailing list