Re: How to control relative paths in Unix task?
Re: How to control relative paths in Unix task?
- Subject: Re: How to control relative paths in Unix task?
- From: Ondra Cada <email@hidden>
- Date: Tue, 23 Jul 2002 01:37:56 +0200
On Monday, July 22, 2002, at 11:20 , John Nairn wrote:
My question: I expect the relative path used in the unix process is
building off the unix working directory
Right.
and that directory is set to the application's directory by default.
Wrong. It is set to the parent task's (your application's) cwd. Which is
effectively undefined (actually, PB sets it to the app's bundle path, and
Finder to root; other launchers can do just anything, and if you run an
app from Terminal, it would be the cwd of the parent shell).
How can I control that location and thereby control how the unix process
resolves relative paths when it creates file?
Probably the best way is to set the path explicitly when you are launching
the unix command -- see -[NSTask setDirectoryPath].
Another possibility is to change the app's cwd -- see
setCurrentDirectoryPath (or so) in NSFileManager.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
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.