full path to source file __FILE__

Jacob Carlborg via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jul 21 23:45:58 PDT 2016


On 2016-07-22 04:24, Jonathan Marler wrote:

> The script depends on other files relative to where it exists on the
> file system.  I couldn't think of a better design to find these files
> then knowing where the script exists, can you?

What kind of files are we talking about. Resource files, config files? 
Are they static? For static resource files you can bundle them in the 
executable with a string import. For config files it might be better to 
store it in a completely different directory, like the user's home 
directory. This actually depends on what kind of config files and the 
operating system.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list