The script I'm working on is supposed to read a file, which contents is dynamically changed (/proc/stat). I need to re-read the first line about every second. That makes me wonder:
- How do I move the access pointer to the beginning of the file (and can I do it at all in a text mode)?
- Do I need to close and reopen the file every time I want to read the updated content?
Any pointers are appreciated...
--------------------------------
An idea is not responsible for the people who believe in it...
In reply to Reopen file when contents changed? by bofh_of_oz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |