English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 02 November 2019, 19:32   #1
TCH
Newbie Amiga programmer

 
Join Date: Jun 2012
Location: Front of my A500+
Age: 33
Posts: 165
Execute() do not works under 1.3

I am trying to run an external program like this
Code:
Execute("programname", 0, 0);
and under 2.0+, it works perfectly, but under 1.3 it returns immediately without running the program. I've tried to open
dos.library
before it
Code:
struct Library *dos = OpenLibrary("dos.library", 33);
if (dos == NULL)
{
	fprintf(stderr, "OpenLibrary() failed.\n");
	return 1
}
but nothing has changed. (Under 2.0+, it worked without this.)

What is the difference? I assume i have to open a library under 1.3, but which?
TCH is offline  
Old 02 November 2019, 20:30   #2
ross
Per aspera ad astra

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 49
Posts: 2,230
Do you have 'Run' in C:?

Under KS1.x is mandatory.
ross is offline  
Old 02 November 2019, 23:26   #3
TCH
Newbie Amiga programmer

 
Join Date: Jun 2012
Location: Front of my A500+
Age: 33
Posts: 165
No i did not have it, i did not know, that under 1.3
Execute()
relies on an external program. Thanks for pointing out: now it works under 1.3.
TCH is offline  
Old 03 November 2019, 01:02   #4
Galahad/FLT
Going nowhere

Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 46
Posts: 7,323
Quote:
Originally Posted by TCH View Post
No i did not have it, i did not know, that under 1.3
Execute()
relies on an external program. Thanks for pointing out: now it works under 1.3.
"Run" as well as a list of other programs were integrated into Kickstart 2.0+
Galahad/FLT is offline  
Old 03 November 2019, 01:31   #5
TCH
Newbie Amiga programmer

 
Join Date: Jun 2012
Location: Front of my A500+
Age: 33
Posts: 165
I've noticed that WB3.1 did not have a
Run
command, but i did not know, that
Execute()
calls
Run
and not the other way.
TCH is offline  
Old 06 November 2019, 01:03   #6
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 280
Quote:
Originally Posted by TCH View Post
I've noticed that WB3.1 did not have a
Run
command, but i did not know, that
Execute()
calls
Run
and not the other way.
Actually, that is only the case for (the BCPL-implemented) dos.library in v34 and below. The logic changed in v36 and the C/asm version of the dos.library. There, Execute() calls into System(), and so does C:Run. Execute() does not depend on C:Run anymore.
Thomas Richter is offline  
Old 21 November 2019, 17:02   #7
TCH
Newbie Amiga programmer

 
Join Date: Jun 2012
Location: Front of my A500+
Age: 33
Posts: 165
I see, thanks.
TCH is offline  
Old 21 November 2019, 20:38   #8
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 48
Posts: 498
I have a routine, which relies on
Code:
*****   SYSTEM0 execute command from disk. From Sozobon C distribution.
* Copyright © 1988 by Ralph Babel.
*
* This piece of code may be used as part of any product as
* long as the source code for the complete program can be
* obtained free of charge (except for a small copying fee)
* and this copyright notice is left unchanged.
it works on everything (1.2-3.1 tried at least), and doesn't need Run.

Exposes this mysystem(char *cmd)
(define NDEBUG to lose all the debugging msgs send to serial)

Has a stupid bug I can't seem to iron out. If command is resident then it crashes when my code tries
Code:
    /*
    Forbid();
    if (list->count > 0)
      list->count--;
    Permit();
    */
which is why I have it commented out. Other than that, it works
Hope it helps.
Attached Files
File Type: zip system.zip (7.5 KB, 18 views)
alkis is offline  
Old 21 November 2019, 20:59   #9
redblade
Zone Friend

redblade's Avatar
 
Join Date: Mar 2004
Location: Middle Earth
Age: 35
Posts: 1,365
Love those people who share their source
redblade is offline  
Old 21 November 2019, 22:55   #10
TCH
Newbie Amiga programmer

 
Join Date: Jun 2012
Location: Front of my A500+
Age: 33
Posts: 165
@alkis:

Thank you for sharing your source. Although i have already released my program, i will study your code to get a better view on the mechanism of running something on the Amiga.

Furthermore, i would like to re-share it on my website; could you please tell me the last year you have modified the files? Are the file dates correct in the zip archive? (2009 for the C and 2014 for the ASM file.) I need this, because i display a release date for downloads.
TCH is offline  
Old 22 November 2019, 00:39   #11
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 48
Posts: 498
You are welcome. Both files have modification date in 2019.


Code:
unzip -v system.zip 
Archive:  system.zip
 Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
--------  ------  ------- ---- ---------- ----- --------  ----
    8713  Defl:N     3166  64% 2019-11-09 16:38 aa5e684d  mysystem.c
   11274  Defl:N     4162  63% 2019-04-14 19:49 8dca550b  system0.asm
--------          -------  ---                            -------
   19987             7328  63%                            2 files
the two timestamps there agree with my filesystem's.
alkis is offline  
Old 22 November 2019, 13:00   #12
TCH
Newbie Amiga programmer

 
Join Date: Jun 2012
Location: Front of my A500+
Age: 33
Posts: 165
Weird.
unzip
gave these dates for me too, but Ark not:



It seems, that it interprets the date in a wrong order. But that is not so surprising, as Ark sucks in a lot of aspects.

I've uploaded your sources to my website, thanks again.

Last edited by TCH; 22 November 2019 at 13:03. Reason: explaining ark's errorenous behaviour
TCH is offline  
Old 22 November 2019, 18:58   #13
matburton
Registered User

matburton's Avatar
 
Join Date: Apr 2017
Location: Cambridge
Posts: 94
In case it's interesting I also got caught out by Execute needing Run

What a PITA!
matburton is offline  
Old 22 November 2019, 19:02   #14
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 48
Posts: 498
totally off-topic, but Ark 17.12.3 displays the correct timestamps (kubuntu 18.04.3)
alkis is offline  
Old 22 November 2019, 23:20   #15
TCH
Newbie Amiga programmer

 
Join Date: Jun 2012
Location: Front of my A500+
Age: 33
Posts: 165
@matburton:

In the thread you were told, that you only should edit the list between
Forbit()
and
Permit()
, but alkis was exactly tried to do that and his code has crashed. Did you experience the same? (I do not understand why Leffman called
BSTR
horror: a leading byte what holds the length for the text-chunk makes much more sense, that terminating it with a
NUL
; ANSI strings have indefinite lengths by definition, which i always considered as crazy. That's why
strlen()
in C is "expensive", it has to iterate the entire data block, just to know the size. And also, it means, that you cannot use
NUL
characters in ANSI strings... But this is off here.)

@alkis:

This is Ark 2.6.4 from TDE. I guess they do not paid too much attention to Ark, so this is not fixed.
TCH is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Execute file without using execute VoltureX support.Apps 3 01 December 2011 10:59
Execute script works but not after adding an icon with IconX as Default Tool. e5frog support.Other 19 27 July 2010 11:23
I can't execute installer paulo_becas support.Apps 5 01 March 2010 11:02
Workbench execute routine BlueAchenar Coders. General 4 14 January 2009 17:38
Execute a script frikilokooo project.ClassicWB 6 20 November 2007 12:36

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 18:58.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.08278 seconds with 14 queries