BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Relative pathnames

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc
View previous topic :: View next topic  
Author Message
Steve Loft
Guest





PostPosted: Mon Mar 01, 2004 12:45 pm    Post subject: Relative pathnames Reply with 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?
--
Steve Loft
Back to top
Catherine Rees Lay
Guest





PostPosted: Mon Mar 01, 2004 1:18 pm    Post subject: Re: Relative pathnames Reply with quote



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





PostPosted: Mon Mar 01, 2004 2:19 pm    Post subject: Re: Relative pathnames Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.