CurrentDir() get current process path?

About Monkey 2 Forums Monkey 2 Programming Help CurrentDir() get current process path?

This topic contains 3 replies, has 3 voices, and was last updated by  Richard Betson 2 years, 6 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #4163

    Richard Betson
    Participant

    Hi,

    CurrentDir() reports the current path of the process, but I am not sure that it does. When compiling the bananas particle example CurrentDir() on Linux reports the process path as:

    /home/moonbasealpha/Programming/monkey2-07/

    But the actual process is located here:

    /home/moonbasealpha/Programming/monkey2-07/bananas/particles/particles.products/Linux/

    I’m wondering why CurrentDir() reports the current path of the process incorrectly?

    #4164

    Mark Sibly
    Keymaster

    I think you’re probably after ‘AppDir()’, ie: the dir the application is in.

    CurrentDir() can be changed with ChangeDir() and is the base dir for relative file names.

    CurrentDir() will be different at startup depending on how the app was launched, eg: via console or desktop etc.

    #4166

    dawlane
    Participant

    I would suspect that it depends on what directory you were in when the process was started. At a guess you ran the program via the IDE, so try changing directory into where the application is.

    Edit: Or use the command Mark has mentioned.

    #4167

    Richard Betson
    Participant

    I think you’re probably after ‘AppDir()

    Indeed I am. I was confused by doc description. Thanks for the help.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.