Can't rename a folder



I'm trying to rename a folder with
RenameFile( old_name, new_name );

But it's throwing an error 32 (file/folder already in use).
I checked both paths and are correct.

I suspect the error comes from a TOpenDialog.
This TOpenDialog asks the user to open a file:

openDialog:= TOpenDialog.Create( nil );
openDialog.InitialDir := Dir + 'projects';
openDialog.Filter := 'XML files|*.xml|All files|*.*';
openDialog.Title := 'Select a file project';
openDialog.Options := [ofReadOnly];
//Display openDialog
if openDialog.Execute then
load_project_info( openDialog.FileName )
openDialog.free;

This works ok, but after that I'm not able to modify any file/folder
element inside folder selected by user.

load_project_info loads some data from file selected, but this is not
the problem 'cause I try to comment this line and the error persists.

I'm not able to change folder's name not even from windows explorer
(after using TOpenDialog); when my program exits then I can.
.



Relevant Pages

  • Re: Archive files
    ... "archive" and it should take the file or folder, copy it to a subfolder in ... in the present directory called archive, and the rename the file/folder ...
    (microsoft.public.windows.server.scripting)
  • Win Expl toolbar
    ... I need to know if there's any way to put "create folder" and "rename ... file/folder" in toolbar, I use these two functions a lot and it's a real ...
    (microsoft.public.win2000.general)
  • I cannot rename any file or folder.
    ... When I try to rename a file or folder I get the warning that if I do choose ... "rename" option into File/Folder task box to the left of my screen. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Re-accruing photos in a slideshow
    ... > numerical order and then select this new folder for screen saver but you ... > still will not get the photos to displayed in order. ... > If you want to try it, you can batch rename very quickly using XP. ... > in the order you placed the thumbnails. ...
    (microsoft.public.windowsxp.photos)
  • Re: Creating slideshows in XP
    ... familiar with the Irfanview software, which lets you gather a particular set ... the pictures, and then it closes, i.e. doesn't do a continuous loop. ... I can take that new folder with the renamed files you mentioned and convert ... > If you need to batch rename and number, you can do this easily with XP. ...
    (microsoft.public.windowsxp.photos)