• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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: 21872
36
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!