---
name: "al_set_physfs_file_interface"
section: "3"
platform: "linux"
package: "allegro"
version: "5.2.11.3-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/al_set_physfs_file_interface"
---

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

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(3)](/ALLEGRO_FILE_INTERFACE/3.md) and [ALLEGRO\_FS\_INTERFACE(3)](/ALLEGRO_FS_INTERFACE/3.md) for the calling thread.

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

To remember and restore another file I/O backend, you can use [al\_store\_state(3)](/al_store_state/3.md)/[al\_restore\_state(3)](/al_restore_state/3.md).

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

*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(3)](/al_set_new_file_interface/3.md).
