chiark / gitweb /
progs/cc-progress.c: Use `fstat' to discover the file size.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 24 Nov 2018 19:06:45 +0000 (19:06 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 24 Nov 2018 20:14:25 +0000 (20:14 +0000)
commitb93f70544f62811a35afc9d607fb933fb061f370
tree21e246c7223a7cfab15731f89fd5676a759a2e73
parent49b0f1b429467da3e46118a608a38e142dc7657e
progs/cc-progress.c: Use `fstat' to discover the file size.

And `lseek' to discover the current offset.  Annoyingly, Android only
developed `ftello64' and `fseeko64' in API24, so we can't use these (and
it was a pretty grim circumlocution anyway).  On the other hand, Android
has had `lseek64' forever, and its `fstat' is natively 64-bit; and
there's no portability benefit to using the other functions because
Windows doesn't have them anyway.  (Indeed, `lseek' and `stat' are
ancient Unix, so probably more portable.)
progs/cc-progress.c