file_exists

Tells if a file exists.

Description

int file_exists(const char *filename, int attrib, int *aret);
Checks whether a file matching the given name and attributes (see beginning of this chapter) exists. If `aret' is not NULL, it will be set to the attributes of the matching file. Example:
      /* Check for a normal file. */
      if (file_exists("franken.dat", 0, NULL))
	 allegro_message("It is alive!\n");
Returns non-zero if the file exists, or zero if it doesn't or the specified attributes mask it out.

Related Discussions

The following threads each have code containing this keyword: Note: You can click on the numbers to jump directly to the posts that reference this page.

Related Projects

The following projects include source code containing this keyword: