Click to See Complete Forum and Search --> : SaveDialog bug


furiousel
October 14th, 2005, 06:22 AM
If you open a SaveDialog box and you save a file to path "C:\example\test.txt" for example, then you cannot rename or delete the folder "example" until you close the application. An error message appears and tells us that the folder is in use by another application.

You can see the problem if you save a document in Word for example, with the Save As dialog. Then close the document without closing Word and try to rename the parent folder of this file. You Cannot!

So, the SaveDialog box constrains the file. Do you know how we can free this file handle? I am using Borland C++ Builder 6.

Helias

PeejAvery
October 14th, 2005, 07:31 AM
It is not a glitch. It is a standard in Windows. Certain applications will lock a file until the application is closed.

I am not sure but I think that it might be a form of file locking.

furiousel
October 17th, 2005, 02:34 AM
Yes, it's standard but it's silly. I am writing an MDI application and I need to open a file, then close it and then rename it and I can't do it. Is there any way to prevent this file locking?

PeejAvery
October 17th, 2005, 06:35 AM
Internal commands (of your programming language) of renaming a file should not be affected because it will be your program that has the file lock.

What language are you writing in?