<p>Is there a way to find the size of a file object that is currently open?</p>

<p>Specifically, I am working with the tarfile module to create tarfiles, but I don't want my tarfile to exceed a certain size.  As far as I know, tarfile objects are file-like objects, so I imagine a generic solution would work.</p>

If you have the file descriptor, you can use
```
fstat
```
to find out the size, if any. A more generic solution is to seek to the end of the file, and read its location there.