Wondering if one file is open for writing in and another programe is accessing it recursively in tcl.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You have a unique file descriptor, so you don’t have to worry about someone else’s file seek messing up yours. Just be aware that the data can change at any time, without warning. Also, make sure that the other program won’t be truncating the file at any point in time; if it does, it can leave you suddenly and unexpectedly reading from an invalid address. If the other app is simply appending data (as in a logger flushing data to a logfile), then you shouldn’t have to worry about that.
If the other app is sensitive enough that having your app read the file concurrently would mess it up, then it should be changing the file permissions to deny read access while it is modifying the file.