The OpenD Programming Language

getSize

Get size of file name in bytes.

  1. ulong getSize(R name)
  2. ulong getSize(R name)

Parameters

name R

string or range of characters representing the file name

Return Value

Type: ulong

The size of file in bytes.

Throws

FileException on error (e.g., file not found).

Examples

scope(exit) deleteme.remove;

// create a file of size 1
write(deleteme, "a");
assert(getSize(deleteme) == 1);

// create a file of size 3
write(deleteme, "abc");
assert(getSize(deleteme) == 3);

Meta