---
name: "al_set_physfs_file_interface"
section: "3alleg5"
platform: "linux"
package: "allegro5-doc"
version: "2:5.2.10.1+dfsg-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/al_set_physfs_file_interface/3alleg5"
---

# al\_set\_physfs\_file\_interface(3alleg5)

Allegro 5 API

## NAME

al\_set\_physfs\_file\_interface - Allegro 5 API

## SYNOPSIS

-

  ```
  #include <allegro5/allegro_physfs.h>
  void al_set_physfs_file_interface(void)
  ```

## DESCRIPTION

This function sets *both* the ALLEGRO\_FILE\_INTERFACE(3alleg5) and ALLEGRO\_FS\_INTERFACE(3alleg5) for the calling thread.

Subsequent calls to al\_fopen(3alleg5) on the calling thread will be handled by PHYSFS\_open(). Operations on the files returned by al\_fopen(3alleg5) will then be performed through PhysicsFS. Calls to the Allegro filesystem functions, such as al\_read\_directory(3alleg5) or al\_create\_fs\_entry(3alleg5), on the calling thread will be diverted to PhysicsFS.

To remember and restore another file I/O backend, you can use al\_store\_state(3alleg5)/al\_restore\_state(3alleg5).

*Note:* due to an oversight, this function differs from al\_set\_new\_file\_interface(3alleg5) and al\_set\_standard\_file\_interface(3alleg5) which only alter the current ALLEGRO\_FILE\_INTERFACE(3alleg5).

*Note:* PhysFS does not support the text-mode reading and writing, which means that Windows-style newlines will not be preserved.

## SEE ALSO

al\_set\_new\_file\_interface(3alleg5).
