0

Possible Duplicate:
How can I determine what process has a file open in Linux?

Can I run a script/use a tool that monitors a file and counts the number of access that are made to it (both read and write). I am running multiple threads and trying to record the number of reads/writes that are made to the file.

0

1 Answer 1

1

Take a look at the strace command. Which will display or record system calls from process. For example, this will record the open, read, and write systems calls made by the command cat /etc/passwd to the file /tmp/tracelog

strace -o /tmp/tracelog -f -e trace=open,read,write cat /etc/passwd
0

Not the answer you're looking for? Browse other questions tagged .