Results 1 to 5 of 5

Thread: Weird application folder problem.

  1. #1

    Question Weird application folder problem.

    Im having a problem its like this:
    whenever I run an application from folder such as a folder like: pong.
    and there is a pong exectuable and a pongmenu.tga,when I click pong run it, it says missing pongmenu.tga. but it's right there. when I open terminal type ./pong run it,everything works fine, and it even happens when I use wine,directly run by click say mame.exe it complain about missing files again!, but it gone when I am using wine mame.exe in terminal again. what is causing that problem ? it's so weird? thanks for help.

  2. #2
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: Weird application folder problem.

    Im having a problem its like this:
    whenever I run an application from folder such as a folder like: pong.
    and there is a pong exectuable and a pongmenu.tga,when I click pong run it, it says missing pongmenu.tga. but it's right there. when I open terminal type ./pong run it,everything works fine, and it even happens when I use wine,directly run by click say mame.exe it complain about missing files again!, but it gone when I am using wine mame.exe in terminal again. what is causing that problem ? it's so weird? thanks for help.
    Sounds like the problem is the working or default folder is not changed just because you can find it in a file manager. When you run a terminal session and change to its folder, it is now the default, at least when it was ran. You will notice that for any program in your menu, you can define a work path which is the default folder when you start the application, like doing a cd work path before running the application. Consider creating a menu entry to start the program, putting in the work path and you could then put that icon on your desktop.

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  3. #3

    Default Re: Weird application folder problem.

    thanks, with your hint, I solve the problem with wine by open exe with command:
    ”wine start /Unix“ instead of "wine"
    but with linux executable,I couldn't find a way to solve that problem, I use kdevelop to compile a lot of small apps.and some of( a lot of) them are basically just for test purpose. so there might be a way, open all linux executable with a sh script but I don't know how to get $1 script parameter's directory and I don't know if this is a dead end or there my be a more simple way to set work directory of current executable to the folder which I just clicked.

    thank you again for your help

  4. #4
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Weird application folder problem.

    On 2011-06-16 10:36, allked wrote:

    > ... but I don't know how to get $1
    > script parameter's directory and I don't know if this is a dead end or
    > there my be a more simple way to set work directory of current
    > executable to the folder which I just clicked.


    With a script, yes.

    The full path and name is in $0. You have to remove the file name, and you
    get the path.

    man basename, man dirname


    However.

    It is not customary for programs to work in the same directory as they are:
    that's an MsDos/Windows practice. Programs reside in directories like /bin,
    /usr/bin, /home/username/bin, and data files reside elsewhere.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

  5. #5
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: Weird application folder problem.

    thanks, with your hint, I solve the problem with wine by open exe with command:
    ”wine start /Unix“ instead of "wine"
    but with linux executable,I couldn't find a way to solve that problem, I use kdevelop to compile a lot of small apps.and some of( a lot of) them are basically just for test purpose. so there might be a way, open all linux executable with a sh script but I don't know how to get $1 script parameter's directory and I don't know if this is a dead end or there my be a more simple way to set work directory of current executable to the folder which I just clicked.

    thank you again for your help
    If you can do it manually, we can automate it. If you need to extract a files location in order to change to its folder, we can do that. Just give me an example of how you are doing it manually right now.

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •