[Coco] Fwd: Re: Get the current work path

Stephen Fischer SFischer1 at Mindspring.com
Thu Feb 15 00:16:25 EST 2018




-------- Forwarded Message --------
Subject: Re: [Coco] Get the current work path
Date: Wed, 14 Feb 2018 21:13:28 -0800
From: Stephen Fischer <SFischer1 at Mindspring.com>
To: L. Curtis Boyle <curtisboyle at sasktel.net>

In a program I wrote in "C" I remember getting the current drive name 
and then working up to the current directory. It was nasty but worked.

If interested ask for the online 80T2S DNS=3 disk with the source.

SHF


On 2/14/2018 7:51 PM, L. Curtis Boyle wrote:
> 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