C# Delete File If Exists

[Solved] C# Delete File If Exists | Csharp - Code Explorer | yomemimo.com
Question : delete file c

Answered by : funny-fox-vlalkmceq3nr

/* remove example: remove myfile.txt */
#include <stdio.h>
int main ()
{ if( remove( "myfile.txt" ) != 0 ) perror( "Error deleting file" ); else puts( "File successfully deleted" ); return 0;
}

Source : https://www.cplusplus.com/reference/cstdio/remove/ | Last Update : Sun, 27 Jun 21

Question : c check if file was created

Answered by : wild-wildebeest-u997xgv9xwwc

int canCreateFile(char* path)
{	FILE* file = fopen(path, "w");	if(file) {	fclose(file);	return 1; }	return 0;
}

Source : | Last Update : Mon, 06 Jul 20

Answers related to c# delete file if exists

Code Explorer Popular Question For Csharp