Check out example codes for "c check if file was created". It will help you in understanding the concepts better.

Code Example 1

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

Learn ReactJs, React Native from akashmittal.com