Problems running UNIX Apps in Cocoa GUI
Problems running UNIX Apps in Cocoa GUI
- Subject: Problems running UNIX Apps in Cocoa GUI
- From: Alberto <email@hidden>
- Date: Mon, 25 Mar 2002 00:35:42 -0300
On 24.03.2002 23:03, "Adam Eijdenberg" <email@hidden> wrote:
>
I'm no expert, but it sounds like your command line tools are creating
>
your log files in the local working directory. If you call these from
>
the terminal they appear to create the files in the same directory as
>
the binaries reside only because you are cd'ing to that directory before
>
you run them. To see what I mean, put runref in a directory called test,
>
then cd to the directory above test and run "test/runref" (minus the
>
quotes). Then your files will be created in the directory above test.
>
>
It looks as though when your GUI is calling the tools the working
>
directory is set to "/" which I believe is 100% standard behavior.
>
>
If you require that these files are created in the same directory as the
>
actual tools, then use argv [0] in your command line tools which I think
>
lets you get the directory you want.
>
>
I'm sure this has come up before, check the archives for more info.
>
>
Hope that helps,
>
Adam
Adam,
I think that what is happening is exactly what I wrote....
I did some changes, ... including what you wrote:
#import <Cocoa/Cocoa.h>
int main(int argc, const char *argv[0])
{
return NSApplicationMain(argc, argv);
}
However, my UNIX app continue using CONFIG file in "/" folder.
All others I was able to change to the same folder as the main application,
except CONFIG file. And I know that the problem is not in the UNIX app, but
where the GUI believe it is... as you wrote.
Could anybody else help ? I'd like, with this little work, develop a SAMPLE
for people that want develop Aqua GUI for UNIX command line Applications.
1) execute command-line commands or applications, from Aqua; (+/- OK)
2) read and/or write txt files, from Aqua; (+/- OK)
3) read and/or write txt files (specific lines or words in the txt file),
from Aqua. (-)
Thanx a lot...
Alberto V. M.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.