Page 1 of 1

Sourcefile ist still locked on HDD after closing TAB in IDE

Posted: Tue Apr 16, 2019 1:54 pm
by Kurzer
Windows 7 x64 SP2 / Purebasic 5.62 and 5.70.

- Create a directory on your hard drive and copy a PureBasic sourceode file to this directory
- Start PB and load the sourcode via drag and drop into the IDE
- Compile the source code
- Then close the TAB with the sourcecode.

Now the directory is still locked by the PureBasic IDE. You cannot delete it until the PureBasic IDE is closed.

Regards,
Kurzer

Re: Sourcefile ist still locked on HDD after closing TAB in

Posted: Tue Apr 16, 2019 6:36 pm
by infratec
I reported this already years ago, but many of the other users was not able to reproduce this.

Maybe it is only on network drives.

Re: Sourcefile ist still locked on HDD after closing TAB in

Posted: Tue Apr 16, 2019 6:40 pm
by Kurzer
Thanks for confirming this problem.
In my case its not a network directory. It's drive D:\ the second partition of my systems harddrive.

btw.: The problem only occurs, if the file was loaded via drag and drop! If you write a fresh programcode in the IDE and save it or if you load a sourcecode via filemenu from hdd and close the tab, then there is no lock on the file.

Re: Sourcefile ist still locked on HDD after closing TAB in

Posted: Tue Apr 16, 2019 8:07 pm
by Little John
Problem confirmed for PB 5.70 LTS on Windows 10, using a local drive.

Re: Sourcefile ist still locked on HDD after closing TAB in

Posted: Tue Apr 16, 2019 10:04 pm
by Dude
kurzer wrote:Compile the source code
When you say compile, do you mean compile and run (F5 key), or create executable? I read it as compile and run.

Re: Sourcefile ist still locked on HDD after closing TAB in

Posted: Tue Apr 16, 2019 10:17 pm
by skywalk
I also noticed this and thought it standard behavior.
It may be the IDE mechanism that checks for source code file changes still has a file handle?

Re: Sourcefile ist still locked on HDD after closing TAB in

Posted: Wed Apr 17, 2019 8:52 am
by Kurzer
Dude wrote:When you say compile, do you mean compile and run (F5 key), or create executable?
Yes, compile and run is correct. It is not necessary to create an executable.

I haven't tested since when the problem exists, but I can imagine that it has to do with the implementation of the formerly new TabBar gadget. The TabBar gadget is originally from the user Stargate and has been used by Fred in the past to make the PB IDE Multi-TAB capable. A bug may have been built into this implementation.

As I said, the problem only exists if you drag and drop a file into one of the editor TABs.
skywalk wrote:It may be the IDE mechanism that checks for source code file changes still has a file handle?
I dont think so, because why the IDE have to check for changes, if the sourcecode is actually not loaded in the IDE?

Re: Sourcefile ist still locked on HDD after closing TAB in

Posted: Wed Apr 17, 2019 9:49 am
by Dude
kurzer wrote:the problem only exists if you drag and drop a file into one of the editor TABs
Nope, I also get the problem if I load the app normally, without using drag and drop:

https://i.imgur.com/ganeD6f.png

Using Win 10 Pro (64-bit) with PureBasic v5.70 LTS Final (32-bit).

PB 572 b1: Sourcefile ist still locked on HDD after closing

Posted: Sun Feb 02, 2020 9:35 pm
by Kurzer
PB 572 b1 x64, Windows 7 x64 SP1:

This Bug is still alive.
- Create a directory on your hard drive and copy a PureBasic sourceode file to this directory (e.g. Debug "Hello World")
- Start PB and load the sourcode via drag and drop into the IDE
- Compile the source code (F5)
- Then close the TAB with the sourcecode.
Now you can switch to explorer (or your favorite filemanger) and try to delete...
a) the sourcecode file which was loaded in the IDE
b) the directory where the sourcecode file is located

The deletion of a) is possible, but not the deletion of b)!
Why the directory is still locked by the PureBasic IDE?

Kurzer