Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

File sharing with Windoze progams  RSS feed

 
Frits Schouten
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
I have a weather station datalogger that records into a (binary)database.
I've managed to decypher the structure of that database and are now able to read that file using a simple Java progam.
The problem I'm now experiencing is that occasionally when my Java program reads that file, the datalogger wants to write at the same time, it fails and it pops a box up that the database is not accessable. This stops all further recordings until I click the 'ok' button which can sometimes be days later.
It there a way to write the Java program such that it is doing a read shared and leaving the datalogger program free to write to it's own database?
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried RandomAccessFile? I know a Java program can use it to read/write to the same file. Not sure about other processes. . .
 
Lo�c HERVE
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've got the same problem... And I think that the RandomAccessFile won't work with an other process.
I try using a FileChannel from java.nio but... it don't work.
Now, I think that Java can't share files with other processes. So, now I just want to test if the file is already opened by the other process (in my case, it's a Flash Player...) and, I don't find anything for listening to filesystem's events.
Some ideas?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!