Board index » delphi » Delphi and "Current Directory"...ARRRGH !

Delphi and "Current Directory"...ARRRGH !

There is one *insane* thing about delphi, and now I've wasted half an hour
(again) understanding absolutely nothing...
Whenever you do a File | Open, "Current Directory" is changed. I believe this
is an OS thingy, otherwise it's  stored internally in Delphi. The insane
thing is, when I have opened an old unit, from a previous version of my
project, Delphi actually mixes up the two units !! Whaddyagivme ? Is there
*any* reason why "Current Directory" of the drive in question should affect
what units are used for either compilation or IDE debugging ? If you ask me,
"Current Directory" should not be used outside DOS environments. Talking
about "Current Directory" in WinXX is insane.

Any comments, or any advice ? Any reasonable arguments why this still exists
?

--
Bjoerge Saether
Consultant / Developer
http://www.itte.no
Asker, Norway
bjorge@takethisaway_itte.no (remve the obvious)

 

Re:Delphi and "Current Directory"...ARRRGH !


On Mon, 26 Nov 2001 00:02:24 +0100, "Bj?rge S?ther"

Quote
<REMOVE_bsaether@THIS_online.no> wrote:
>There is one *insane* thing about delphi, and now I've wasted half an hour
>(again) understanding absolutely nothing...
>Whenever you do a File | Open, "Current Directory" is changed. I believe this
>is an OS thingy, otherwise it's  stored internally in Delphi. The insane

The current directory is -usually- the last directory (in that
instance of delphi) that you opened a file from.  If you open FileA
from DirA, when you go to open FileB, it will default to DirA.

This setting is persistant across closes/opens of the IDE.

Quote
>Any comments, or any advice ? Any reasonable arguments why this still exists

To make it easier to open multiple files in the same directory, one
after another.

What really gets me is that this -doesn't- work with the default
project save directory, nor the image directory.  Every time you start
delphi the default is back to the delphi install default.

I don't know about everyone else out there, but I don't save my
projects under the delphi folder.

Re:Delphi and "Current Directory"...ARRRGH !


Quote
On Sun, 25 Nov 2001 23:59:06 GMT, a...@rfnj.org (asymmetric) wrote:
>On Mon, 26 Nov 2001 00:02:24 +0100, "Bj?rge S?ther"
><REMOVE_bsaether@THIS_online.no> wrote:

>>There is one *insane* thing about delphi, and now I've wasted half an hour
>>(again) understanding absolutely nothing...
>>Whenever you do a File | Open, "Current Directory" is changed. I believe this
>>is an OS thingy, otherwise it's  stored internally in Delphi. The insane

>The current directory is -usually- the last directory (in that
>instance of delphi) that you opened a file from.  If you open FileA
>from DirA, when you go to open FileB, it will default to DirA.

>This setting is persistant across closes/opens of the IDE.

>>Any comments, or any advice ? Any reasonable arguments why this still exists

>To make it easier to open multiple files in the same directory, one
>after another.

>What really gets me is that this -doesn't- work with the default
>project save directory, nor the image directory.  Every time you start
>delphi the default is back to the delphi install default.

>I don't know about everyone else out there, but I don't save my
>projects under the delphi folder.

Me neither. But if I understand what it is you want, try changing the
"Start in:" folder in your Delphi shortcut.

That works for me to get Delphi starting out in the folder where I put
all my projects.

Stephen Posey
slpo...@concentric.net

Re:Delphi and "Current Directory"...ARRRGH !


Quote
Stephen Posey <slpo...@concentric.net> wrote in message

news:3c01c2e3.36554908@news.concentric.net...

Quote
> On Sun, 25 Nov 2001 23:59:06 GMT, a...@rfnj.org (asymmetric) wrote:

> >On Mon, 26 Nov 2001 00:02:24 +0100, "Bj?rge S?ther"
> ><REMOVE_bsaether@THIS_online.no> wrote:

> >>There is one *insane* thing about delphi, and now I've wasted half an
hour
> >>(again) understanding absolutely nothing...
> >>Whenever you do a File | Open, "Current Directory" is changed. I believe
this
> >>is an OS thingy, otherwise it's  stored internally in Delphi. The insane

> >The current directory is -usually- the last directory (in that
> >instance of delphi) that you opened a file from.  If you open FileA
> >from DirA, when you go to open FileB, it will default to DirA.

> >This setting is persistant across closes/opens of the IDE.

> >>Any comments, or any advice ? Any reasonable arguments why this still
exists

> >To make it easier to open multiple files in the same directory, one
> >after another.

> >What really gets me is that this -doesn't- work with the default
> >project save directory, nor the image directory.  Every time you start
> >delphi the default is back to the delphi install default.

> >I don't know about everyone else out there, but I don't save my
> >projects under the delphi folder.

> Me neither. But if I understand what it is you want, try changing the
> "Start in:" folder in your Delphi shortcut.

> That works for me to get Delphi starting out in the folder where I put
> all my projects.

Me neither..... but changing Start In did nothing for me. File open seems to
be working on the folder used by the last file open for that project.
Changing project seems to change the working directory correctly, yet I'm
sure it never used to do this when I kept my projects in with the Delphi
folder!  Oh well, I gave up on this one ages ago, and simply watch like a
hawk for the file path on the title bar. But........ you're right it should
be more determinate, obvious, documented or whatever.

Dave

Re:Delphi and "Current Directory"...ARRRGH !


In article <EKeM7.3463$v05.68...@news1.oke.nextra.no>, "Bj?rge S?ther"

Quote
<REMOVE_bsaether@THIS_online.no> writes:
>Is there
>*any* reason why "Current Directory" of the drive in question should affect
>what units are used for either compilation or IDE debugging ?

Because (I think) all directories in the .dpr and Search Paths are relative.

I have been trying to suss out what the impact of entries in .dpr (ie from View
| Project Manager) and Seach Path (ie from Project | Options |
Directories/Conditionals) have on function.

AFAICT ...

Search Paths will only use a .dcu and will not recompile from .pas, even on a
Build All.

Project Manager is a copy of the .dpr files, and  ...

Project | Compile will make from all the .dcu files for the units in PM. If
there is a .pas, but no .dcu, or the .pas date is later than the .dcu date then
a new .dcu is compiled.

Project | Build All will recompile .dcu from all the units in PM.

Units called from units in PM will be dealt with on the same rules ie if in PM
will be compiled as PM above, if in Search Path as in Search Path above.

Find in Files will find only in the files referenced in PM.

Any corrections / comments on this please.

Alan Lloyd
alangll...@aol.com

Re:Delphi and "Current Directory"...ARRRGH !


--
Bjoerge Saether
Consultant / Developer
http://www.itte.no
Asker, Norway
bjorge@takethisaway_itte.no (remve the obvious)
"AlanGLLoyd" <alangll...@aol.com> skrev i melding
news:20011126043319.04359.00001227@nso-fq.aol.com...

Quote
> In article <EKeM7.3463$v05.68...@news1.oke.nextra.no>, "Bj?rge S?ther"
> <REMOVE_bsaether@THIS_online.no> writes:

> >Is there
> >*any* reason why "Current Directory" of the drive in question should
affect
> >what units are used for either compilation or IDE debugging ?

> Because (I think) all directories in the .dpr and Search Paths are
relative.

> I have been trying to suss out what the impact of entries in .dpr (ie from
View
> | Project Manager) and Seach Path (ie from Project | Options |
> Directories/Conditionals) have on function.

> AFAICT ...

> Search Paths will only use a .dcu and will not recompile from .pas, even on
a
> Build All.

> Project Manager is a copy of the .dpr files, and  ...

> Project | Compile will make from all the .dcu files for the units in PM. If
> there is a .pas, but no .dcu, or the .pas date is later than the .dcu date
then
> a new .dcu is compiled.

> Project | Build All will recompile .dcu from all the units in PM.

> Units called from units in PM will be dealt with on the same rules ie if in
PM
> will be compiled as PM above, if in Search Path as in Search Path above.

> Find in Files will find only in the files referenced in PM.

> Any corrections / comments on this please.

What really puzzles me, is the impact of setting Current Directory by e.g.
opening a file or doing a "save as". I believe it's mainly a de{*word*81}
problem, the IDE de{*word*81} traces execution into the wrong unit. What I did
yesterday was opening an old version of a unit, to check how things were
written a few months ago. Having an extra unit opened is normally not a
problem, unless opening this file was done prior to compiling. I can't find
any other explaination to what happens, other than Delphi being dragged with
a stupid "Current Directory" that actually takes precedence over the
project's search path. An old DOS-habit of Borland developers, I guess.

Re:Delphi and "Current Directory"...ARRRGH !


AlanGLLoyd <alangll...@aol.com> schreef in berichtnieuws
20011126043319.04359.00001...@nso-fq.aol.com...
[snip]

Quote

> Because (I think) all directories in the .dpr and Search Paths are

relative.

Which is a good thing IMO.
But my D6 does funny things. Some files in the Project Manager are listed as
mapped drives (e.g. H:\dir1\etc... ) , others are listed as full UNC-paths
 e.g. \\server16\share\dir1\etc..  ; I have no clue why/when  D6 does it.
I often work at home, and this has given me much grief when transferring
projects.
Even when I remove files from a project, and add them again, some files
remain UNC, others are mapped.

Rgrds - Dirk

Re:Delphi and "Current Directory"...ARRRGH !


"Dirk Claessens" <will.bou...@back.com> skrev i melding
news:3c029ebf$0$12222$4d4efb8e@news.be.uu.net...

Quote

> AlanGLLoyd <alangll...@aol.com> schreef in berichtnieuws
> 20011126043319.04359.00001...@nso-fq.aol.com...
> [snip]

> > Because (I think) all directories in the .dpr and Search Paths are
> relative.

> Which is a good thing IMO.
> But my D6 does funny things. Some files in the Project Manager are listed
as
> mapped drives (e.g. H:\dir1\etc... ) , others are listed as full UNC-paths
>  e.g. \\server16\share\dir1\etc..  ; I have no clue why/when  D6 does it.
> I often work at home, and this has given me much grief when transferring
> projects.
> Even when I remove files from a project, and add them again, some files
> remain UNC, others are mapped.

And another, really annoying thing: If your directories are reciding in two
or more different "branches", all these branches are converted into relative
paths no matter what. This means, if I have one directory containing standard
units shared amonst many projects, I can't copy the project to another drive,
machine or folder without having to recreate the very same structure
containing *both* the project stuff and my standard units. Sometimes this is
really annoying.

I remember being a newbie in Delphi, the first program I tried to create was
a "Delphi Project Mover"...never finished it, but I got a job with only this
application in my pocket, though...;-) Now I wish I'd completed it...

--
Bjoerge Saether
Consultant / Developer
http://www.itte.no
Asker, Norway
bjorge@takethisaway_itte.no (remve the obvious)

Re:Delphi and "Current Directory"...ARRRGH !


Quote
On Sun, 25 Nov 2001 23:59:06 GMT, a...@rfnj.org (asymmetric) wrote:
>What really gets me is that this -doesn't- work with the default
>project save directory, nor the image directory.  Every time you start
>delphi the default is back to the delphi install default.

Try to check Autosave Options |Project Desktop and Editor files in
Tools|Environment setup

Other Threads