---
name: "Mat_GetFileAccessMode"
section: "3"
platform: "linux"
package: "libmatio"
version: "1.5.30-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/Mat_GetFileAccessMode"
---

# Mat\_GetFileAccessMode(3)

Returns the file access mode of a MATLAB MAT file given a MAT file structure.

## NAME

**Mat\_GetFileAccessMode** – Returns the file access mode of a MATLAB MAT file given a MAT file structure.

## SYNOPSIS

**#include \<matio.h\>**

*enum* *mat\_acc*\

**Mat\_GetFileAccessMode**(*const mat\_t \*matfp*);

## DESCRIPTION

The **Mat\_GetFileAccessMode**() function returns the file access mode of the MATLAB MAT file given by the MAT file structure.

## RETURN VALUES

The return value is one of the following:

- **MAT\_ACC\_RDONLY** if the file is opened with read-only access or not opened at all.

- **MAT\_ACC\_RDWR** if the file is opened with read/write access.

## SEE ALSO

[Mat\_CreateVer(3)](/Mat_CreateVer/3.md), [Mat\_Open(3)](/Mat_Open/3.md), [Mat\_GetFilename(3)](/Mat_GetFilename/3.md), [Mat\_GetHeader(3)](/Mat_GetHeader/3.md)
