From 85207b59bd065b5fd8d1c7c0302e153dcd941554 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 15 Apr 2022 22:33:43 +0200 Subject: Add ::tell(). --- src/file.cc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/file.cc') diff --git a/src/file.cc b/src/file.cc index 74db8396..8ab50293 100644 --- a/src/file.cc +++ b/src/file.cc @@ -175,6 +175,27 @@ File::seek(int64_t offset, int whence) } +int64_t +File::tell() +{ + DCP_ASSERT(_file); +#ifdef LIBDCP_WINDOWS + return _ftelli64(_file); +#else + return ftell(_file); +#endif +} + + + +int +File::error () +{ + DCP_ASSERT(_file); + return ferror(_file); +} + + /** Windows can't "by default" cope with paths longer than 260 characters, so if you pass such a path to * any boost::filesystem method it will fail. There is a "fix" for this, which is to prepend * the string \\?\ to the path. This will make it work, so long as: -- cgit v1.2.3