delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/14/18:10:52

From: "Jean-Gael Gricourt" <jean-gael DOT gricourt AT snet DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: remove() don't work ?
Date: 12 May 1997 15:09:35 GMT
Organization: Organization
Lines: 29
Message-ID: <01bc5ede$42f78680$eb173ccc@jordan>
NNTP-Posting-Host: brpt01-sh4-port235.snet.net
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi,

Please, someone tell me why It is impossible to erase a file with
'remove()'  :

Note: I runned it under Win 95 inside a dos box.

-------------------------------------------------
#include <stdio.h>

int main()
{
 FILE *tmp=fopen("ex.$$$","w");

 if(tmp==NULL) { perror("fopen");return 1; }

 fprintf(tmp,"Just a try.");

 if(remove("ex.$$$")!=0) puts("I can't get ride of this #$?% file ! Why
?");

 fclose(tmp);

 return 0;
}
-------------------------------------------------

JGG

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019