[Coco] Get the current work path

L. Curtis Boyle curtisboyle at sasktel.net
Wed Feb 14 22:51:43 EST 2018


Nope. Even the PWD command itself traverses the directory tree backwards building the full path as it goes.(It does a GetStat to get the current drive name, however).

L. Curtis Boyle
curtisboyle at sasktel.net



> On Feb 14, 2018, at 9:43 PM, Wayne Campbell <asa.rand at gmail.com> wrote:
> 
> I think you're right Curtis. There is no system call I can find for
> returning current working or execution directory. SHELL "ex pwd" and SHELL
> "ex pxd" work in Basic09, but only return the path to stdout and trying to
> put the output into a variable results in an error. Your method is probably
> the one to use, though it requires extra code.
> 
> On Wed, Feb 14, 2018 at 7:37 PM, L. Curtis Boyle <curtisboyle at sasktel.net>
> wrote:
> 
>> I don’t think you can do it quite that easily. Are you running stock
>> OS9/shell, or Nitros9/shellplus?
>> What you may have to do is SHELL “PWD >-tempfile”
>> Then open tempfile, read a line (which will have your path), close it, and
>> then delete tempfile.
>> (shellplus supports the '>-‘ to overwrite an existing file. If using
>> standard shell, you will likely have to do an ON ERROR GOTO and try opening
>> it first, and closing/deleting it if it opens without an error).
>> 
>> 
>> L. Curtis Boyle
>> curtisboyle at sasktel.net
>> 
>> 
>> 
>>> On Feb 14, 2018, at 9:22 PM, phil pt <ptaylor2446 at gmail.com> wrote:
>>> 
>>> Thanks
>>> 
>>> 
>>> 
>>> On Wed, Feb 14, 2018 at 10:20 PM, Wayne Campbell <asa.rand at gmail.com>
>> wrote:
>>> 
>>>> Are you typing that at the command prompt for OS 9? In basic 09, it has
>> to
>>>> be a statement in a source code file compiled in the basic 09 editor and
>>>> one from there if it is still giving you an error then check to make
>> sure
>>>> that ex pwd is in quotes. I have to get my computer and Boot It Up to
>> run a
>>>> test and give you some actual code give me a little time and I will post
>>>> back here with what I figure out.
>>>> 
>>>> On Feb 14, 2018 7:05 PM, "phil pt" <ptaylor2446 at gmail.com> wrote:
>>>> 
>>>>> I did that var$:=SHELL "ex pwd"  and I got a error
>>>>> 
>>>>> On Wed, Feb 14, 2018 at 10:04 PM, Wayne Campbell <asa.rand at gmail.com>
>>>>> wrote:
>> 
>> 
>> --
>> Coco mailing list
>> Coco at maltedmedia.com
>> https://pairlist5.pair.net/mailman/listinfo/coco
>> 
> 
> 
> 
> -- 
> Wayne
> 
> The Structure of I-Code
> http://www.cocopedia.com/wiki/index.php/The_Structure_of_I-Code
> 
> decode
> http://cococoding.com/wayne/
> 
> -- 
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
> 



More information about the Coco mailing list