Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
al_fopen(3)		    Library Functions Manual		     al_fopen(3)

NAME
     al_fopen - Allegro 5 API

SYNOPSIS
	    #include <allegro5/allegro.h>

	    ALLEGRO_FILE *al_fopen(const char *path, const char *mode)

DESCRIPTION
     Creates  and  opens  a file (real or virtual) given the path and mode.  The
     current file interface is used to open the file.

     Parameters:

     * path - path to the file to open

     * mode - access mode to open the file in ("r", "w", etc.)

     Depending on the stream type and the mode string, files may  be  opened  in
     "text"  mode.  The handling of newlines is particularly important.  For ex-
     ample, using the default stdio-based streams on DOS and Windows  platforms,
     where  the  native  end-of-line  terminators are CR+LF sequences, a call to
     al_fgetc(3) may return just one character (`\n') where there were two bytes
     (CR+LF) in the file.  When writing out `\n', two bytes would be written in-
     stead.  (As an aside, `\n' is not defined to be equal to LF either.)

     Newline translations can be useful for text files but is disastrous for bi-
     nary files.  To avoid this behaviour you need to open file streams  in  bi-
     nary mode by using a mode argument containing a "b", e.g. "rb", "wb".

     Returns a file handle on success, or NULL on error.

SEE ALSO
     al_set_new_file_interface(3), al_fclose(3).

Allegro reference manual					     al_fopen(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=al_fopen&sektion=3&manpath=FreeBSD+Ports+15.1.quarterly>

home | help