Getting the directory of executable (like GetModuleFileName)

Discussion of Common Lisp

Re: Getting the directory of executable (like GetModuleFileN

Postby MicroVirus » Mon Jun 18, 2012 5:23 am

Thanks for your responses.
edgar-rft wrote:It's generally not desirable to have a function returning the location of the executable, because this opens the door and invites all virii of the internet to manipulate the executable.

I don't understand what you mean with this. Any Windows executable can get its own location using GetModuleFileName or from another process it can access with query rights using GetModuleFileNameEx. Finally, any virus could easily search the system for *.exe files. So, I'm guessing I didn't understand what you meant here.

I know about the 'proper' location for config files; it's just that this is a little project which will be used by me and a friend where the config file will have to be manually edited, so for ease of use I'd like it in the same directory, like the old-school INI files.

I'm thinking about simply requiring the current working directory to be set properly before opening the program. Probably easiest.
MicroVirus
 
Posts: 11
Joined: Sat Apr 07, 2012 6:20 am

Previous

Return to Common Lisp

Who is online

Users browsing this forum: Google [Bot] and 2 guests