Re: How to get start up path?

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Tue, 25 Feb 2003 06:36:58 +0000, Liu Junfeng <rufi at 163.com> wrote:

>
> When an application start up, how to get the path where it locates?
>
> current_dir() return the name of the current working directory, if the 
> applicate was started by another application,( for example Medit) 
> current_dir() returns something not desired.
>
>

The way I do it, is I look at the second parameter returned by 
command_line(). If that does not start with a drive letter, I prepend the 
current_dir() to it. This means that if I run ...
   ex demo\prog.ex

I get "demo\prog.ex" from command_line(), and as there is no drive letter, 
I just add the current dir to it.

This is not perfect as the current_dir() function only returns the current 
directory of the current drive. This means that if my current drive is "D:" 
and its current directory is "\DEMOS\" and I run this ...

  ex c:prog.ex

I cannot find out what the current directory for the C: drive is from 
within the program I'm running. Well I can, but I have to resort to DOS 
interrupt calls.

-- 

cheers,
Derek Parnell

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu