 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Steve Loft Guest
|
Posted: Mon Mar 01, 2004 12:45 pm Post subject: Relative pathnames |
|
|
My application reads and writes to a number of files, and I've been
accessing them using names relative to the application's working directory.
I'm using madExcept, and when this gets triggered, if the user chooses
to email a bug report and then continue, the working directory gets set
to the email program's working directory, and all my file accesses fail.
Am I wrong to be using absolute paths? Should I be doing
AppDir := ExtractFilePath(Application.ExeName);
at startup and then using this to create absolute file paths everywhere?
--
Steve Loft
|
|
| Back to top |
|
 |
Catherine Rees Lay Guest
|
Posted: Mon Mar 01, 2004 1:18 pm Post subject: Re: Relative pathnames |
|
|
In article <esnbh1-1gh.ln1 (AT) galena (DOT) nybbles.co.uk>, Steve Loft
<steve (AT) nybbles (DOT) co.uk> writes
| Quote: | My application reads and writes to a number of files, and I've been
accessing them using names relative to the application's working
directory.
I'm using madExcept, and when this gets triggered, if the user chooses
to email a bug report and then continue, the working directory gets set
to the email program's working directory, and all my file accesses fail.
Am I wrong to be using absolute paths? Should I be doing
AppDir := ExtractFilePath(Application.ExeName);
at startup and then using this to create absolute file paths everywhere?
|
I'd always use an absolute filepath created on-the-fly as you suggest -
it's just too easy for the working directory to get changed. You may
think no user will ever need to change the properties of the icon on the
desktop - but if your program depends on them not doing so you can bet
that someone will!
Catherine.
--
Catherine Rees Lay
To email me, use my first name in front of the "at".
|
|
| Back to top |
|
 |
J French Guest
|
Posted: Mon Mar 01, 2004 2:19 pm Post subject: Re: Relative pathnames |
|
|
On Mon, 01 Mar 2004 12:45:48 +0000, Steve Loft <steve (AT) nybbles (DOT) co.uk>
wrote:
| Quote: | My application reads and writes to a number of files, and I've been
accessing them using names relative to the application's working directory.
I'm using madExcept, and when this gets triggered, if the user chooses
to email a bug report and then continue, the working directory gets set
to the email program's working directory, and all my file accesses fail.
Am I wrong to be using absolute paths? Should I be doing
AppDir := ExtractFilePath(Application.ExeName);
at startup and then using this to create absolute file paths everywhere?
|
Yes - you should
- but you also need to post a bug report to 'mad'
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|