FILE* file_open_relative(const char* path, const char* mode, const char* zero_arg)
{
	char buffer[IO_BUFFER_SIZE];
	get_path_to_file(buffer, path, zero_arg);
	FILE* fp = fopen(buffer, mode);
	if (!fp)
		die("Coudn't open file");
	return fp;
}
Ejemplo n.º 2
0
nomask static int file_exists(string file) {
   string dir;

   dir = get_path_to_file(file);

   if (!valid(dir, MODE_READ)) {
#ifdef ENABLE_STACK_SECURITY
      return 0;
#else
      console_msg("Access to " + file +
	 " would have been denied, ignoring...\n");
#endif
   }
   return::file_exists(file);
}