Sourcefile ist still locked on HDD after closing TAB in IDE

Post bugs related to the IDE here
User avatar
Kurzer
Enthusiast
Enthusiast
Posts: 664
Joined: Sun Jun 11, 2006 12:07 am
Location: Near Hamburg

Sourcefile ist still locked on HDD after closing TAB in IDE

Post 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
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2023: 56y
"Happiness is a pet." | "Never run a changing system!"
infratec
Always Here
Always Here
Posts: 6817
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

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

Post 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.
User avatar
Kurzer
Enthusiast
Enthusiast
Posts: 664
Joined: Sun Jun 11, 2006 12:07 am
Location: Near Hamburg

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

Post 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.
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2023: 56y
"Happiness is a pet." | "Never run a changing system!"
Little John
Addict
Addict
Posts: 4519
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

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

Post by Little John »

Problem confirmed for PB 5.70 LTS on Windows 10, using a local drive.
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

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

Post 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.
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

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

Post 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?
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
Kurzer
Enthusiast
Enthusiast
Posts: 664
Joined: Sun Jun 11, 2006 12:07 am
Location: Near Hamburg

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

Post 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?
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2023: 56y
"Happiness is a pet." | "Never run a changing system!"
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

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

Post 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).
User avatar
Kurzer
Enthusiast
Enthusiast
Posts: 664
Joined: Sun Jun 11, 2006 12:07 am
Location: Near Hamburg

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

Post 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
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2023: 56y
"Happiness is a pet." | "Never run a changing system!"
Post Reply