Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to lock a file?

 
Mark Guo
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys
I encountered a problem, when my server side writing a file name "A".txt not finished, the user side begin to read my "A".txt file, so the user get the file not perfect, please give me a solution to solve this problem and how to make the file be thread safe?
Thanks in advance!
 
Chris Hurst
Ranch Hand
Posts: 443
3
C++ Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This isn't read a threading question I suggest you try one of the other forums, your actually trying to make it process safe I believe. Also mentioning which OS your on will help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic