Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Prototype designs always work. -- Don Vonada


devel / comp.sys.acorn.programmer / Re: How to run cmd line task from within a BASIC program

SubjectAuthor
* How to run cmd line task from within a BASIC programPaul Stewart
+* Re: How to run cmd line task from within a BASIC programHarriet Bazley
|+- Re: How to run cmd line task from within a BASIC programPaul Stewart
|`* Re: How to run cmd line task from within a BASIC programMatthew Phillips
| `- Re: How to run cmd line task from within a BASIC programdruck
`* Re: How to run cmd line task from within a BASIC programGerph
 `- Re: How to run cmd line task from within a BASIC programPaul Stewart

1
How to run cmd line task from within a BASIC program

<37b525a459.Paul@outlook.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=72&group=comp.sys.acorn.programmer#72

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!aioe.org!4X5OkOiARHvxoDBZHDK13w.user.46.165.242.75.POSTED!not-for-mail
From: narrowbo...@outlook.com (Paul Stewart)
Newsgroups: comp.sys.acorn.programmer
Subject: How to run cmd line task from within a BASIC program
Date: Sat, 01 Jan 2022 21:10:39 GMT
Organization: Aioe.org NNTP Server
Lines: 24
Message-ID: <37b525a459.Paul@outlook.com>
Injection-Info: gioia.aioe.org; logging-data="52869"; posting-host="4X5OkOiARHvxoDBZHDK13w.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Messenger-Pro/8.05wpb1 (RemoteNB/3.13) (RISC-OS/4.42)
X-Notice: Filtered by postfilter v. 0.9.2
X-Editor: EmailEdit 2.04
 by: Paul Stewart - Sat, 1 Jan 2022 21:10 UTC

Hi,

I have a little WIMP program I have written in BASIC.
As part of the Run file, it runs a *command and out puts results to a
file. This works fine.

However I would like to be able to run the same command within a procedure
in the program to allow the file to be refreshed.

I have tried using SYS "OS_CLI","ifconfig -a > <Wimp$ScrapDir>.ifinfo"
This has the desired effect, being that it sends output of ifconfig -a to
the ifinfo file in the scrap folder. However the program stops at this
point :( Having opened a task window, and entered BASIC. Running the
above SYS command exits BASIC and returns to command prompt. Obviously
the same is occurring when attempting to run as part of the program and
explains why it just stops without any error.

Is SYS "OS_CLI" the correct command I should be using for this? Or is
there another equally simple command to use that allows the program to
continue after it has run?

--
Paul Stewart
Sent from A9home running RISC OS 4.42

Re: How to run cmd line task from within a BASIC program

<53513ba459.harriet@bazleyfamily.co.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=73&group=comp.sys.acorn.programmer#73

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: harr...@bazleyfamily.co.uk (Harriet Bazley)
Newsgroups: comp.sys.acorn.programmer
Subject: Re: How to run cmd line task from within a BASIC program
Date: Sun, 02 Jan 2022 01:06:42 GMT
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <53513ba459.harriet@bazleyfamily.co.uk>
References: <37b525a459.Paul@outlook.com>
Injection-Info: reader02.eternal-september.org; posting-host="047d3f776340ab27322e3cb2ada5d8c7";
logging-data="13450"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18rYJEicE8YhUhyXo1QDTbIXYFE2BLxhD0="
User-Agent: Messenger-Pro/8.04 (MsgServe/8.04) (RISC-OS/5.27) NewsHound/v1.53-32 RC1
Cancel-Lock: sha1:6roLZRriyhL3Id7uCA2L2KyctrQ=
X-Clacks-Overhead: GNU Terry Pratchett
 by: Harriet Bazley - Sun, 2 Jan 2022 01:06 UTC

On 1 Jan 2022 as I do recall,
Paul Stewart wrote:

> I have a little WIMP program I have written in BASIC.
> As part of the Run file, it runs a *command and out puts results to a
> file. This works fine.
>
> However I would like to be able to run the same command within a procedure
> in the program to allow the file to be refreshed.
>
> I have tried using SYS "OS_CLI","ifconfig -a > <Wimp$ScrapDir>.ifinfo"
> This has the desired effect, being that it sends output of ifconfig -a to
> the ifinfo file in the scrap folder. However the program stops at this
> point :( Having opened a task window, and entered BASIC. Running the
> above SYS command exits BASIC and returns to command prompt. Obviously
> the same is occurring when attempting to run as part of the program and
> explains why it just stops without any error.
>
> Is SYS "OS_CLI" the correct command I should be using for this? Or is
> there another equally simple command to use that allows the program to
> continue after it has run?
>
I think you probably need to do "SYS Wimp_StartTask" rather than trying
to use OSCLI.

See https://www.riscosopen.org/forum/forums/11/topics/1753 , for
example.

--
Harriet Bazley == Loyaulte me lie ==

Own nothing you do not know to be useful or believe to be beautiful.

Re: How to run cmd line task from within a BASIC program

<d1c6a5a459.Paul@outlook.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=74&group=comp.sys.acorn.programmer#74

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!aioe.org!U/KX8ba/OMuTXW5s0P7Tsg.user.46.165.242.75.POSTED!not-for-mail
From: narrowbo...@outlook.com (Paul Stewart)
Newsgroups: comp.sys.acorn.programmer
Subject: Re: How to run cmd line task from within a BASIC program
Date: Sun, 02 Jan 2022 20:29:31 GMT
Organization: Aioe.org NNTP Server
Lines: 14
Message-ID: <d1c6a5a459.Paul@outlook.com>
References: <37b525a459.Paul@outlook.com> <53513ba459.harriet@bazleyfamily.co.uk>
Injection-Info: gioia.aioe.org; logging-data="29604"; posting-host="U/KX8ba/OMuTXW5s0P7Tsg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Messenger-Pro/8.05wpb1 (RemoteNB/3.13) (RISC-OS/4.42)
X-Notice: Filtered by postfilter v. 0.9.2
X-Editor: EmailEdit 2.04
 by: Paul Stewart - Sun, 2 Jan 2022 20:29 UTC

In message <53513ba459.harriet@bazleyfamily.co.uk>
Harriet Bazley <harriet@bazleyfamily.co.uk> wrote:

> I think you probably need to do "SYS Wimp_StartTask" rather than trying
> to use OSCLI.

> See https://www.riscosopen.org/forum/forums/11/topics/1753 , for
> example.

Thanks Harriet. Exactly what I was looking for :)

--
Paul Stewart
Sent from A9home running RISC OS 4.42

Re: How to run cmd line task from within a BASIC program

<4c90eca559.Matthew@sinenomine.co.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=84&group=comp.sys.acorn.programmer#84

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!border2.nntp.ams1.giganews.com!nntp.giganews.com!buffer2.nntp.ams1.giganews.com!buffer1.nntp.ams1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Wed, 05 Jan 2022 01:55:39 -0600
Date: Wed, 05 Jan 2022 07:58:54 GMT
From: spam20...@yahoo.co.uk (Matthew Phillips)
Newsgroups: comp.sys.acorn.programmer
Subject: Re: How to run cmd line task from within a BASIC program
Message-ID: <4c90eca559.Matthew@sinenomine.co.uk>
References: <37b525a459.Paul@outlook.com> <53513ba459.harriet@bazleyfamily.co.uk>
User-Agent: Messenger-Pro/8.04 (MsgServe/8.04S) (RISC-OS/5.16) NewsHound/v1.50-32
Lines: 48
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-ttUvKPHPmU/ZGFqHesCbvnaumrFbbNFFhPYkvxKJah4slvl7yav96ifUHBrwlzAE4RVbgttK5xwdb3E!bFkDJWBBNuaca6X8d7f/R+EPP1xDalQuHEpk0AeoDG81gvSIbrvsj9bWxENMVZ5260S1QrYt/MBl!IAMfTOrw
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 3049
 by: Matthew Phillips - Wed, 5 Jan 2022 07:58 UTC

In message <53513ba459.harriet@bazleyfamily.co.uk>
on 2 Jan 2022 Harriet Bazley wrote:

> On 1 Jan 2022 as I do recall,
> Paul Stewart wrote:
>
> > I have a little WIMP program I have written in BASIC.
> > As part of the Run file, it runs a *command and out puts results to a
> > file. This works fine.
> >
> > However I would like to be able to run the same command within a procedure
> > in the program to allow the file to be refreshed.
> >
> > I have tried using SYS "OS_CLI","ifconfig -a > <Wimp$ScrapDir>.ifinfo"
> > This has the desired effect, being that it sends output of ifconfig -a to
> > the ifinfo file in the scrap folder. However the program stops at this
> > point :( Having opened a task window, and entered BASIC. Running the
> > above SYS command exits BASIC and returns to command prompt. Obviously
> > the same is occurring when attempting to run as part of the program and
> > explains why it just stops without any error.
> >
> > Is SYS "OS_CLI" the correct command I should be using for this? Or is
> > there another equally simple command to use that allows the program to
> > continue after it has run?
> >
> I think you probably need to do "SYS Wimp_StartTask" rather than trying
> to use OSCLI.
>
> See https://www.riscosopen.org/forum/forums/11/topics/1753 , for
> example.

This comes from IfConfig being a separate program rather than being part of
an operating system module. You can find it in
$.!Boot.Resources.!Internet.bin

The way the Wimp works any task when it is running is essentially
single-tasking and running another program via the command line interpreter
replaces the current program in memory. That's why you have to ask the Wimp
to do it via Wimp_StartTask.

The WISC OS Wimp is all a big conjuring trick so that you can seemingly
multi-task on an operating system which is little different from the BBC
Micro really. The low-level stuff like the command line interpreter knows
nothing about multi-tasking.

--
Matthew Phillips
Durham

Re: How to run cmd line task from within a BASIC program

<sr4mf4$jmc$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=85&group=comp.sys.acorn.programmer#85

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: new...@druck.org.uk (druck)
Newsgroups: comp.sys.acorn.programmer
Subject: Re: How to run cmd line task from within a BASIC program
Date: Wed, 5 Jan 2022 18:02:12 +0000
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <sr4mf4$jmc$1@dont-email.me>
References: <37b525a459.Paul@outlook.com>
<53513ba459.harriet@bazleyfamily.co.uk> <4c90eca559.Matthew@sinenomine.co.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 5 Jan 2022 18:02:12 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="0627ebcc208f2b756eaca87a3559c4b0";
logging-data="20172"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1807Vy1ixJxOQIqesPnGGq/"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
Cancel-Lock: sha1:bK6fTTbm59HJCHXbkFapHJwdBL8=
In-Reply-To: <4c90eca559.Matthew@sinenomine.co.uk>
Content-Language: en-GB
 by: druck - Wed, 5 Jan 2022 18:02 UTC

On 05/01/2022 07:58, Matthew Phillips wrote:
> The way the Wimp works any task when it is running is essentially
> single-tasking and running another program via the command line interpreter
> replaces the current program in memory. That's why you have to ask the Wimp
> to do it via Wimp_StartTask.
>
> The WISC OS Wimp is all a big conjuring trick so that you can seemingly
> multi-task on an operating system which is little different from the BBC
> Micro really. The low-level stuff like the command line interpreter knows
> nothing about multi-tasking.

You can still do the old BBC Micro trick of copying your self to higher
in memory, and using OSCLI to run the task in the vacated lower memory.
But its easier these days to use Wimp_StartTask as MP says.

---druck

Re: How to run cmd line task from within a BASIC program

<2e3fd371-c4c3-4993-9c94-3ef2d5ec15bbn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=86&group=comp.sys.acorn.programmer#86

  copy link   Newsgroups: comp.sys.acorn.programmer
X-Received: by 2002:a37:44cd:: with SMTP id r196mr23219863qka.90.1642640000774;
Wed, 19 Jan 2022 16:53:20 -0800 (PST)
X-Received: by 2002:a05:622a:1209:: with SMTP id y9mr3926789qtx.277.1642640000624;
Wed, 19 Jan 2022 16:53:20 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!3.eu.feeder.erje.net!feeder.erje.net!npeer.as286.net!npeer-ng0.as286.net!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.acorn.programmer
Date: Wed, 19 Jan 2022 16:53:20 -0800 (PST)
In-Reply-To: <37b525a459.Paul@outlook.com>
Injection-Info: google-groups.googlegroups.com; posting-host=109.159.22.243; posting-account=F8N0MgoAAADewp5ULAxcVKZKmScNxlSz
NNTP-Posting-Host: 109.159.22.243
References: <37b525a459.Paul@outlook.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2e3fd371-c4c3-4993-9c94-3ef2d5ec15bbn@googlegroups.com>
Subject: Re: How to run cmd line task from within a BASIC program
From: ger...@gerph.org (Gerph)
Injection-Date: Thu, 20 Jan 2022 00:53:20 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2459
 by: Gerph - Thu, 20 Jan 2022 00:53 UTC

On Saturday, 1 January 2022 at 21:10:47 UTC, Paul Stewart wrote:
> Hi,
>
> I have a little WIMP program I have written in BASIC.
> As part of the Run file, it runs a *command and out puts results to a
> file. This works fine.
>
> However I would like to be able to run the same command within a procedure
> in the program to allow the file to be refreshed.
>
> I have tried using SYS "OS_CLI","ifconfig -a > <Wimp$ScrapDir>.ifinfo"

Which won't work because, as you've seen, it replaces your application. There is no process control on RISC OS, so you suffer here.

However, your specific problem is that you want to read (I assume) information about the interfaces on the system. This is relatively trivial to do. How relative is a subjective matter, but it only needs calls that are defined in BSD sockets interfaces used by most systems. Because of this they're 'easily' translatable to RISC OS Socket calls. Some years ago I created some examples to show how this could be done in BASIC.

The very old examples can be found on my usenet sharing site (https://usenet.gerph.org/Internet/), but a year ago I placed slightly improved versions in the RISC OS examples repository at https://github.com/gerph/riscos-examples/tree/master/networking/sockets

Re: How to run cmd line task from within a BASIC program

<1d95e7ad59.Paul@outlook.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=87&group=comp.sys.acorn.programmer#87

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!aioe.org!usruSmnpKN2s7s6F9a571Q.user.46.165.242.75.POSTED!not-for-mail
From: narrowbo...@outlook.com (Paul Stewart)
Newsgroups: comp.sys.acorn.programmer
Subject: Re: How to run cmd line task from within a BASIC program
Date: Thu, 20 Jan 2022 19:54:07 GMT
Organization: Aioe.org NNTP Server
Lines: 38
Message-ID: <1d95e7ad59.Paul@outlook.com>
References: <37b525a459.Paul@outlook.com> <2e3fd371-c4c3-4993-9c94-3ef2d5ec15bbn@googlegroups.com>
Injection-Info: gioia.aioe.org; logging-data="23842"; posting-host="usruSmnpKN2s7s6F9a571Q.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Messenger-Pro/8.05wpb1 (RemoteNB/3.13) (RISC-OS/4.42)
X-Notice: Filtered by postfilter v. 0.9.2
X-Editor: EmailEdit 2.04
 by: Paul Stewart - Thu, 20 Jan 2022 19:54 UTC

In message <2e3fd371-c4c3-4993-9c94-3ef2d5ec15bbn@googlegroups.com>
Gerph <gerph@gerph.org> wrote:

> On Saturday, 1 January 2022 at 21:10:47 UTC, Paul Stewart wrote:
>> Hi,
>>
>> I have a little WIMP program I have written in BASIC.
>> As part of the Run file, it runs a *command and out puts results to a
>> file. This works fine.
>>
>> However I would like to be able to run the same command within a procedure
>> in the program to allow the file to be refreshed.
>>
>> I have tried using SYS "OS_CLI","ifconfig -a > <Wimp$ScrapDir>.ifinfo"

> Which won't work because, as you've seen, it replaces your application.
> There is no process control on RISC OS, so you suffer here.

> However, your specific problem is that you want to read (I assume)
> information about the interfaces on the system. This is relatively trivial
> to do. How relative is a subjective matter, but it only needs calls that
> are defined in BSD sockets interfaces used by most systems. Because of
> this they're 'easily' translatable to RISC OS Socket calls. Some years ago
> I created some examples to show how this could be done in BASIC.

> The very old examples can be found on my usenet sharing site
> (https://usenet.gerph.org/Internet/), but a year ago I placed slightly
> improved versions in the RISC OS examples repository at
> https://github.com/gerph/riscos-examples/tree/master/networking/sockets

Managed to do what I was looking at doing using SYS Wimp_StartTask, which
Harriet pointed me too.

I will however take look at your examples.

--
Paul Stewart
Sent from A9home running RISC OS 4.42

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor