Ask a Question related to Mac Programming, Design and Development.
-
Mark #1
current directory
Help!
I am writing an application that can be lauched from either the Finder
or from the command-line. I need to know the locations of two
directories:
1) the directory that the executable is in
2) the current command-line directory
I have figured out how to get (1), here is the code:
FSRef processBundleDirectory;
PSN currentProcess;
GetCurrentProcess(¤tProcess);
GetProcessBundleLocation(¤tProcess, &processBundleDirectory);
I still can't figure out how to get (2).
I know that the File Manager maintains a "default" volume and
directory but this is not the same as the unix command-line "current"
directory.
How can I determine the current directory set in the Terminal window
that just executed the command-line?
Thanks in advance,
Mark
Mark Guest
-
-922 Cannot get name of current working directory
Trying to migrate Informix SE V4.10.UC4 from SCO OpenServer 3.2 release 4.2 to Linux RedHat 8.0, the above mentioned error message shows up from... -
#25846 [Bgs]: is_dir() does not work on any folder other than the current directory
ID: 25846 User updated by: notepad at codewalkers dot com Reported By: notepad at codewalkers dot com Status: Bogus... -
#25846 [Bgs->Opn]: is_dir() does not work on any folder other than the current directory
ID: 25846 User updated by: notepad at codewalkers dot com Reported By: notepad at codewalkers dot com -Status: Bogus... -
Finding current directory?
How can I find out the full directory path (i.e. c:\path\to\file) of a file? I'm logged into a server and the of course, I have an FTP directory... -
How to open a file in the current directory
Set fileSystem = Server.CreateObject( "Scripting.FileSystemObject" ) Set file = fileSystem.OpenTextFile( "config.xml", 1, False ) It's saying... -
Frederick Cheung #2
Re: current directory
On 25 Sep 2003, Mark wrote:
man getcwd ?> Help!
>
> I am writing an application that can be lauched from either the Finder
> or from the command-line. I need to know the locations of two
> directories:
> 1) the directory that the executable is in
> 2) the current command-line directory
>
> I have figured out how to get (1), here is the code:
>
> FSRef processBundleDirectory;
> PSN currentProcess;
> GetCurrentProcess(¤tProcess);
> GetProcessBundleLocation(¤tProcess, &processBundleDirectory);
>
> I still can't figure out how to get (2).
> I know that the File Manager maintains a "default" volume and
> directory but this is not the same as the unix command-line "current"
> directory.
> How can I determine the current directory set in the Terminal window
> that just executed the command-line?
Fred
Frederick Cheung Guest
-
Simon Slavin #3
Re: current directory
In article <f8ef12cd.0309251538.4fbdeb86@posting.google.com >,
[email]mark.suska@sympatico.ca[/email] (Mark) wrote:
I don't think the Finder /has/ a current directory.>I am writing an application that can be lauched from either the Finder
>or from the command-line. I need to know the locations of two
>directories:
>1) the directory that the executable is in
>2) the current command-line directory
It has no interaction with any command line. It doesn't
concentrate on any particular directory. What would you
want to do with that directory ?
Simon Slavin Guest



Reply With Quote

