English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 23 April 2017, 17:22   #1
Zetr0
Ya' like it Retr0?
 
Zetr0's Avatar
 
Join Date: Jul 2005
Location: United Kingdom
Age: 49
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, 17:29   #2
Locutus
Registered User
 
Join Date: Jul 2014
Location: Finland
Posts: 1,176
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 17:35.
Locutus is offline  
Old 23 April 2017, 17:35   #3
Zetr0
Ya' like it Retr0?
 
Zetr0's Avatar
 
Join Date: Jul 2005
Location: United Kingdom
Age: 49
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, 17:40   #4
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,751
There's the dos.library function execute: http://amigadev.elowar.com/read/ADCD.../node015E.html
Thorham is offline  
Old 23 April 2017, 17:50   #5
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Just include <stdlib.h> and your call to system() will compile.
Leffmann is offline  
Old 23 April 2017, 18:14   #6
Zetr0
Ya' like it Retr0?
 
Zetr0's Avatar
 
Join Date: Jul 2005
Location: United Kingdom
Age: 49
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 10:20
Zip help commands mickolite support.Apps 5 16 June 2011 21:00
SAS/C Startup commands Eternal_Newbie support.Apps 2 04 July 2010 00:53
System is not validated! FFS (and I dont mean fast file system!) Macca support.Hardware 11 11 June 2007 13:04
For those of you that must run old MS-DOS games, DOS Box has been ported Pyromania Amiga scene 19 06 June 2003 11: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 16:50.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09492 seconds with 15 queries