---
name: "file_size"
section: "3alleg"
platform: "linux"
package: "liballegro-doc"
version: "2:4.2.0-5"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/file_size"
---

# file\_size(3alleg)

Returns the size of a file in bytes. Allegro game programming library.

## NAME

file\_size - Returns the size of a file in bytes. Allegro game programming library.

## SYNOPSIS

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

**long file\_size(const char \*filename);**

## DESCRIPTION

Returns the size of a file, in bytes. If the file does not exist or an  error occurs, it will return zero and store the system error code in  errno.

## SEE ALSO

[**file\_exists**(3alleg)](/file_exists/3alleg.md), [**file\_time**(3alleg)](/file_time/3alleg.md), [**expackf**(3alleg)](/expackf/3alleg.md)
