WLJS LogoWLJS Notebook

FileSize

FileSize[file] gives the size of a file as a quantity.

Examples

Get the size of a file:

FileSize["example.txt"]
(* Quantity[1024, "Bytes"] *)

Convert to megabytes:

UnitConvert[FileSize["largefile.dat"], "Megabytes"]

Please visit the official Wolfram Language Reference for more details.

On this page