Page 1 of 1

(Dangerous) bug when PB IDE emulates paths

Posted: Sun Feb 11, 2007 5:28 pm
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.

Posted: Sun Feb 11, 2007 6:38 pm
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.

Posted: Sun Feb 11, 2007 7:40 pm
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?