LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-14-2006, 02:08 PM   #1
drgilberto
LQ Newbie
 
Registered: Jan 2006
Location: St.Louis
Distribution: Ubuntu
Posts: 5

Rep: Reputation: 0
Question Nautilus and dirname


1) I have a program that save stuff in the same directory as where it is started. Thus for example, if my program executable is in the directory /tmp/mydir and my program is called myexecutable, its full path is /tmp/mydir/myexecutable

2) Now 'myexecutable' is a program that reads and write files from the very same directory.


3)
If I run 'myexecutable' from the command line from directory /tmp/mydir/myexecutable everything works perfectly.

QUESTION: I want to use a Nautilus launcher on the desktop that starts 'myexecutable'. Simple right, just make a launcher and enter as command 'myexecutable'.

PROBLEM: Nautilus always assumes that the working directory is /home/myuser , but the program will only work correctly if it is started in /tmp/mydir

SOLUTIONS: Is there a way to tell Nautilus what the working dir should be?

The alternative is that I program myexecutable such that it just opens files with the full pathname. But in reality this program can be anywhere. Is there a 'simple' way in Linux gcc to tell where the called binary is that you are calling. Is this in the /proc files somewhere.

Help is appreciated!

Thanks.

Gilberto
 
  


Reply



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
dirname basename; how to capture extensions from bash? carl0ski Linux - General 2 07-22-2005 07:26 AM
dirname error when installing Java JRE jrdioko Linux - Software 0 05-20-2005 05:35 PM
Gnome Nautilus compile failed in [nautilus-printer.lo] chunlee Linux - Software 5 01-24-2005 04:57 PM
Nautilus shariqali Linux - General 1 09-24-2003 11:55 AM
nautilus Spaz17 Linux - Newbie 5 09-22-2003 02:47 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:16 PM.

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