02 November 2019, 18:32 | #1 |
Newbie Amiga programmer
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
|
Execute() do not works under 1.3
I am trying to run an external program like this
Code:
Execute("programname", 0, 0); dos.librarybefore it Code:
struct Library *dos = OpenLibrary("dos.library", 33); if (dos == NULL) { fprintf(stderr, "OpenLibrary() failed.\n"); return 1 } What is the difference? I assume i have to open a library under 1.3, but which? |
02 November 2019, 19:30 | #2 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Do you have 'Run' in C:?
Under KS1.x is mandatory. |
02 November 2019, 22:26 | #3 |
Newbie Amiga programmer
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
|
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. |
03 November 2019, 00:02 | #4 |
Going nowhere
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,986
|
|
03 November 2019, 00:31 | #5 |
Newbie Amiga programmer
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
|
I've noticed that WB3.1 did not have a
Runcommand, but i did not know, that Execute()calls Runand not the other way. |
06 November 2019, 00:03 | #6 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,215
|
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.
|
21 November 2019, 16:02 | #7 |
Newbie Amiga programmer
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
|
I see, thanks.
|
21 November 2019, 19:38 | #8 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
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. 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(); */ Hope it helps. |
21 November 2019, 19:59 | #9 |
Zone Friend
Join Date: Mar 2004
Location: Middle Earth
Age: 40
Posts: 2,127
|
Love those people who share their source
|
21 November 2019, 21:55 | #10 |
Newbie Amiga programmer
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
|
@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. |
21 November 2019, 23:39 | #11 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
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 |
22 November 2019, 12:00 | #12 |
Newbie Amiga programmer
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
|
Weird.
unzipgave 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 12:03. Reason: explaining ark's errorenous behaviour |
22 November 2019, 17:58 | #13 |
Registered User
Join Date: Apr 2017
Location: Cambridge
Posts: 136
|
|
22 November 2019, 18:02 | #14 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
totally off-topic, but Ark 17.12.3 displays the correct timestamps (kubuntu 18.04.3)
|
22 November 2019, 22:20 | #15 |
Newbie Amiga programmer
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
|
@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 BSTRhorror: a leading byte what holds the length for the text-chunk makes much more sense than 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 NULcharacters 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. Last edited by TCH; 21 December 2023 at 23:43. |
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 09:59 |
Execute script works but not after adding an icon with IconX as Default Tool. | e5frog | support.Other | 19 | 27 July 2010 10:23 |
I can't execute installer | paulo_becas | support.Apps | 5 | 01 March 2010 10:02 |
Workbench execute routine | BlueAchenar | Coders. General | 4 | 14 January 2009 16:38 |
Execute a script | frikilokooo | project.ClassicWB | 6 | 20 November 2007 11:36 |
|
|