On Jul 30, 2012, at 8:08 AM, Daniel Stein <dyne2me...@gmail.com> wrote:

> The tool tries to open the file with an ordinary call to fopen():
> f = fopen("my.data",READ_MODE);

Of course this assumes the current directory is the one containing the my.data 
file. By default it won't be, because the tool inherits the current directory 
from the app, and IIRC when an app is launched the CWD is set to the root 
directory of its bundle.

In general it's not a good idea to depend on the CWD in an app anyway. Why not 
pass the absolute path of the data file as a command-line argument to the tool 
from NSTask?

> //[ backEnd setCurrentDirectoryPath: [ path stringByDeletingLastPathComponent 
> ] ];
> 
> Of course, I'm concerned about having had to comment out the 
> setCurrentDirectoryPath operation

Um, yeah. But you haven't said why you commented it out. From what I remember 
about NSTask, that line would have set things up so your existing tool would 
work.

—Jens
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to