The OpenD Programming Language

File.tell

Calls $(CSTDIO ftell) for the managed file handle, which returns the current value of the position indicator of the file handle.

struct File
@property const @trusted
ulong
tell
()

Throws

Exception if the file is not opened. ErrnoException if the call to ftell fails.

Examples

import std.conv : text;
static import std.file;

auto testFile = std.file.deleteme();
std.file.write(testFile, "abcdefghijklmnopqrstuvwqxyz");
scope(exit) { std.file.remove(testFile); }

auto f = File(testFile);
auto a = new ubyte[4];
f.rawRead(a);
assert(f.tell == 4, text(f.tell));

Meta