LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-26-2012, 01:48 PM   #1
dasy2k1
Member
 
Registered: Oct 2005
Location: 127.0.0.1
Distribution: Manjaro
Posts: 963

Rep: Reputation: 36
ln to exicutable not running when running by absolute path works


(Ok im not really a newbie but this could be usefull)

I run Openttd on my ubuntu box a lot
the exicutable lives on my ntfs formatted cross system partition at

/mnt/data/openttd/bin/openttd

I have made a symlink in ~/bin to add openttd to my path but when i run openttd from this path I just get errors about not finding language packs wheas when running the exicutable from the absolute path it works fine

Im guessing this is somthing to do with the exicuatble trying to referance things by relative paths and looking in ~/bin rather than the openttd directory and naturally not finiding what its looking for. but I have no idea on how to rectify this.
 
Old 05-26-2012, 02:30 PM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
Probably you have right. How the game has to know where it is really installed - only from path to self or eventually from working directory. I suggets to create a script in your ~/bin which change working directory to "/mnt/data/openttd/bin" and invoke "/mnt/data/openttd/bin/openttd".

Last edited by eSelix; 05-27-2012 at 06:27 AM.
 
1 members found this post helpful.
Old 05-26-2012, 03:30 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,129

Rep: Reputation: 3639Reputation: 3639Reputation: 3639Reputation: 3639Reputation: 3639Reputation: 3639Reputation: 3639Reputation: 3639Reputation: 3639Reputation: 3639Reputation: 3639
I had to re-read eSelix's post a few times but I think it is correct. The link path is not the same as the actual path environment setting. Guess you could fix it a few ways.
 
Old 05-26-2012, 03:50 PM   #4
dasy2k1
Member
 
Registered: Oct 2005
Location: 127.0.0.1
Distribution: Manjaro
Posts: 963

Original Poster
Rep: Reputation: 36
surely if the exicutable in question was reading the working directory then it would make a differnce if i ran
cd /mnt/data/openttd
./bin/openttd

or /mnt/data/openttd/bin/openttd
but it dosent.

ah well I suppose i can replace my link with a script with the full path in it
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to get the absolute path of the running executable file and current work path ? 915086731 Programming 3 11-01-2011 09:28 AM
How to change Absolute path to Relative path sahil.jammu Linux - Newbie 2 05-31-2011 04:57 AM
getting the path of the running executable lorebett Programming 17 04-15-2009 10:48 AM
Image Path reference in Linux (Absolute path) javabuddy Linux - General 7 06-05-2006 07:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration