Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Is there a way to attach to a process and find out, not only which files it is reading from, but what the read locations (byte offsets) of those reads are?

I tried using strace for this, but it doesn't seem to show that information.

share|improve this question
add comment

1 Answer 1

up vote 11 down vote accepted

you should be able to tap into /proc/$PID/fdinfo for this purpose. Check out the "The phantom progress bar" section at Solving problems with proc

fdinfo tracks a process's current position within an open file.

share|improve this answer
2  
The "phantom progress bar" worked perfectly and was exactly what I needed :) –  Roger Dahl Aug 7 '12 at 23:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.