Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Python

Idiom #95 Get file size

Assign to variable x the length (number of bytes) of the local file at path.

import os
x = os.path.getsize(path)
with Ada.Directories; use Ada.Directories;
X : constant File_Size := Size (Path);

New implementation...
< >
programming-idioms.org