# fileLength -- the length of a file

## Synopsis

• Usage:
fileLength f
• Inputs:
• Outputs:
• an integer, the length of the file f or the file whose name is f

## Description

The length of an open output file is determined from the internal count of the number of bytes written so far.

 i1 : f = temporaryFileName() << "hi there" o1 = /tmp/M2-78388-0/0 o1 : File i2 : fileLength f o2 = 8 i3 : close f o3 = /tmp/M2-78388-0/0 o3 : File i4 : filename = toString f o4 = /tmp/M2-78388-0/0 i5 : fileLength filename o5 = 8 i6 : get filename o6 = hi there i7 : length oo o7 = 8 i8 : removeFile filename