This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem facing Files.listFiles also list the file whose writting is in progress.  RSS feed

 
Amitavghoshbabu Ghosh
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am writing some files (txt) in a location.many application try to access it and write the file in same location.


at 10 minutes interval my scheduler comes and try to read the file and send the mail by reading the content in above directory. but at the same time since many apps are writing the file. any many files may be half written. my schedular reads the half content only and send the file. i want to know is there any way i can block reading the files which are not fully written
 
Paul Clapham
Sheriff
Posts: 22487
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, there isn't.

A better strategy would be for the programs writing the file to write them in a different directory, then move them to the scheduler's directory when they have finished writing.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!