[cc65] fopen

From: Stefan <montecarlos1gmx.net>
Date: 2010-11-14 18:47:25
Dear CC65 community,

i created a c64 program with cc65 version 2.13.9 under the windows system and would like to write an artstudio pic with fopen and fwrite either to the c64 file system or to the windows fs.
Art studio pics have " pic" appended to the filename which is maximum 12 character long, therefore. The " pic" must be the last 4 characters of the filename. 
Using fopen i can open a file called "xyz" without problems, but not 
"   xyz". Using space characters in the filename, fopen returns a zero pointer which means an error. See below.
This was compiled with cc65 2.13.9 without the -O flag with the C64 as target system. 
I guess this is due to the windows convention, that space is not allowed in filenames (when not using long filenames). Is there a workaround?
I really need those spaces in the filename, else i cannot save as ArtStudio!


#include <stdio.h>

void main(void){
	FILE* test;
	
	printf("fopen return: %x", test=fopen("xyz","w"));
	
	fclose(test);
}

output = $15da



#include <stdio.h>

void main(void){
	FILE* test;
	
	printf("fopen return: %x", test=fopen("   xyz","w"));
	
	fclose(test);
}

output = 0


Monte Carlos

-- 
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun Nov 14 18:47:30 2010

This archive was generated by hypermail 2.1.8 : 2010-11-14 18:47:32 CET