Logo

Programming-Idioms

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

Idiom #95 Get file size

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

def main(path) do
  _x =
    path
    |> File.stat!()
    |> Map.get(:size)
end
with Ada.Directories; use Ada.Directories;
X : constant File_Size := Size (Path);

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