[comp.sys.atari.st] Creating a file in C

jeroen@ruuinf.cs.ruu.nl (Jeroen Fokker) (01/08/90)

I want to open a file in R/W mode and be sure that it is empty.
Here's how I do this now:

	Fdelete(name);			(1)
	handle = Fcreate(name,0);	(2)
	Fclose(handle);			(3)
	handle = Fopen(name,2);		(4)

It is remarkably slow. Is there a better way to do it?
If I leave out line 3&4, how does the Atari know I need R/W mode?
If I leave out line 1, won't there be two copies of the file?
If I leave out line 3, wouldn't I get two different file-descriptors?

Please reply by e-mail to  jeroen@cs.ruu.nl
Thanks in advance!
--
Jeroen Fokker, University of Utrecht, the Netherlands