Date: Mon, 7 Jul 1997 12:28:34 +0300 (IDT) From: Eli Zaretskii To: "GRANULAB international B.V." cc: djgpp AT delorie DOT com Subject: Re: remove doesn't delet a file In-Reply-To: <33BCF059.5254@xs4all.nl> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Fri, 4 Jul 1997, GRANULAB international B.V. wrote: > I have problems using the remove function. Here a sample of my code: Your example (slightly modified to make it compile) works for me, both when no data is written and when some data is written to the file. Please post the shortest complete program that exhibits the problem. > _creat(datafile,0x00); > fd = _open(datafile,O_WRONLY); The call to `_open' is unnecessary, since `_creat' also opens the file. The way you've done it, you waste a file handle, and also remove the file while it is still open, which on MS-DOS just invites trouble. > printf(datafile,"%xd",error); This is wrong. You probably wanted to say this: printf("%xd", error); I would also recommend against printing error codes with "%x", because "%x" converts the code to unsigned.