swift-system icon indicating copy to clipboard operation
swift-system copied to clipboard

[Pitch] Add non-throwing FileDescriptor.currentOffset helper

Open sharplet opened this issue 4 years ago • 0 comments

Provided the file descriptor is still valid, accessing the current offset shouldn't fail.


It took me a bit of hunting around to figure out how to access the current offset in a file. I could see this being too trivial to add a helper for, however, after reading the man page for lseek(2), it seemed like the operation shouldn't be able to fail for valid file descriptors, and so there's value in providing a non-throwing way to achieve this.

Would love to hear your feedback. Thanks!

sharplet avatar May 30 '21 16:05 sharplet