(Dangerous) bug when PB IDE emulates paths

Working on new editor enhancements?
AND51
Addict
Addict
Posts: 1040
Joined: Sun Oct 15, 2006 8:56 pm
Location: Germany
Contact:

(Dangerous) bug when PB IDE emulates paths

Post by AND51 »

Hello!

I've opened a main file and several include-files; they're all saved, so PB emulates the path for those files correctly.

Now, I've opened a new tab to create and test a brand new procedure which has nothing to do with the other project. I left the new tab UNSAVED and created 5,000 new test-files (with a FOR-loop).

The PB IDE emulates a wrong path for this new tab: It takes the path from the saved project, but it should use the #PB_Compiler_Home-Directory.

Important note: I used a relative path:

Code: Select all

For n=1 To 5000
	CreateFile(0, Str(n)+" ttttt.txt")
Next
This can be dangerous when testing Delete-Functions as I do currently. The saved project has nothing to do with the new tab in which I was testing new code.
PB 4.30

Code: Select all

onErrorGoto(?Fred)
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

Wrong. For unsaved files, the current directory in which the executable is started
is the current directory of the IDE itself.

So if you start the IDE by doubleclicking on a .pb file. The IDE is started
with that directory as current one, and that is where the unsaved programs are started as well.

It has nothing to do with where you saved your other sourcecode.
quidquid Latine dictum sit altum videtur
AND51
Addict
Addict
Posts: 1040
Joined: Sun Oct 15, 2006 8:56 pm
Location: Germany
Contact:

Post by AND51 »

> So if you start the IDE by doubleclicking on a .pb file. The IDE is started
> with that directory as current one, and that is where the unsaved programs are started as well.
>
> It has nothing to do with where you saved your other sourcecode.
Exactly this is the point. If the unsaved code has nothing to do with the saved project, then why is it emulated to the project's path?
The code I've posted should create 5k files in the Compiler's directory (where the Purebasic0.exe was generated, too).

By the way, you're right: I started the IDE with db-clicking on a *.pb file.

An other suggestion: Why don't you create for every unsaved code a seperated folder? For example, PureBasic0.exe is generated in \Compilers\PureBasic0\; PureBasic1.exe is generated in \Compilers\PureBasic1\ and so on...
Does this give you more saefty?
PB 4.30

Code: Select all

onErrorGoto(?Fred)
Post Reply