English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 23 April 2017, 18:22   #1
Zetr0
Ya' like it Retr0?
Zetr0's Avatar
 
Join Date: Jul 2005
Location: United Kingdom
Age: 43
Posts: 9,768
Using System DOS commands within SAS-C

Hello my fellow forum chummies, buds and friends!

Quick Question -

I have just set up and working SAS-C environment to evolve AGLaunch into something a lot more configurable - I was wondering if there is a way to use DOS commands to create a dumb text file.

Such that

Code:
#include <sdtio.h>
#include <stdlib.h>
#include <string.h>
#include <system.h>

void main (void)
{
        printf("Igor!... Throw tha Switch!!\n\nYesss Mastaaah...\n\n");

        blah code;
        blah code;
        blah code;

        system("DIR DIRS >RAM:tst.txt");

        blah code (open the file in ram)
        blah code (do some shenanigans on txt file)
}
obviously there isn't a <system.h> include with SAS-C so I was wondering if there is there anything like that for the Amiga specifically for SAS-C v658?
Zetr0 is offline  
Old 23 April 2017, 18:29   #2
Locutus
Registered User

 
Join Date: Jul 2014
Location: Finland
Posts: 868
Is there a dirent.h ? Then you could just do this straight from C.

Actually, take a look in the dos autodocs, theres an example using ExamineDir()

Last edited by Locutus; 23 April 2017 at 18:35.
Locutus is offline  
Old 23 April 2017, 18:35   #3
Zetr0
Ya' like it Retr0?
Zetr0's Avatar
 
Join Date: Jul 2005
Location: United Kingdom
Age: 43
Posts: 9,768
Quote:
Originally Posted by Locutus View Post
Is there a dirent.h ? Then you could just do this straight from C.
OooOoo - now this is interesting!
Zetr0 is offline  
Old 23 April 2017, 18:40   #4
Thorham
Computer Nerd

Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 42
Posts: 3,085
There's the dos.library function execute: http://amigadev.elowar.com/read/ADCD.../node015E.html
Thorham is offline  
Old 23 April 2017, 18:50   #5
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,186
Just include <stdlib.h> and your call to system() will compile.
Leffmann is offline  
Old 23 April 2017, 19:14   #6
Zetr0
Ya' like it Retr0?
Zetr0's Avatar
 
Join Date: Jul 2005
Location: United Kingdom
Age: 43
Posts: 9,768
Cheers all!!!

Now cooking with GAS!!!
Zetr0 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
PCMCIA fault: DOS error code 225 - Not a valid DOS disk 4am support.Hardware 2 07 April 2012 11:20
Zip help commands mickolite support.Apps 5 16 June 2011 22:00
SAS/C Startup commands Eternal_Newbie support.Apps 2 04 July 2010 01:53
System is not validated! FFS (and I dont mean fast file system!) Macca support.Hardware 11 11 June 2007 14:04
For those of you that must run old MS-DOS games, DOS Box has been ported Pyromania Amiga scene 19 06 June 2003 12:44

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 03:13.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.06323 seconds with 13 queries