This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes How to lock a file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "How to lock a file?" Watch "How to lock a file?" New topic
Author

How to lock a file?

Mark Guo
Ranch Hand

Joined: Nov 17, 2010
Posts: 58
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

Joined: Oct 26, 2003
Posts: 407
    
    1

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.


"Eagles may soar but weasels don't get sucked into jet engines" SCJP 1.6, SCWCD 1.4, SCJD 1.5,SCBCD 5
 
 
subject: How to lock a file?
 
Similar Threads
Saving JavaMail error to .txt file
How to write code in jsp and hide it from the user
representing as XML
download any file from servlet..
return a text file from webapp