Jump to content
Angus Robertson

Unable to rename source file on save?

Recommended Posts

Delphi 11.2, after editing a unit and trying to save it, I get an error: 

 

Unable to rename 'C:\DelphiComp\ics\Source\OverbyteIcsWebSocketSrv.pas' to 'C:\DelphiComp\ics\Source\__history\OverbyteIcsWebSocketSrv.pas.~74~'.

 

and can do nothing else than abandon changes.  The version 74 does not exist, only 73. 

 

Is there a clever way to save the changes, other than copy/paste to a new file? 

 

Suspect it happens if I edit the same file in another version of Delphi on the same PC, a couple of days ago.

 

Angus

 

 

Share this post


Link to post

One situation would be if the source file is open by something else which will cause the rename to fail. Check if something else has the file open with the openfiles command or Resource Monitor.

 

 

 

Share this post


Link to post

I suspect the old source file was still held open by Delphi after it had said 'another application has updated the file, reload it'. 

 

Tried deleting all historic files, still failed, restarted 11.2 and sanity was restored.

 

Angus

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×