I have a python script that looks like this:
#!/usr/bin/env python3
import tables as pt
import numpy as np
import time
class TestTable(pt.IsDescription):
timestamp = pt.Float64Col()
voltage = pt.Float32Col()
h5file = pt.open_file('does_it_update_dropbox.h5', mode='a')
if not h5file.__contains__('/test'):
h5file.create_table('/', 'test', TestTable)
row = h5file.root.test.row
try:
while True:
time.sleep(10)
for _ in range(1000):
row['timestamp'] = time.time()
row['voltage'] = np.random.random(1)[0]
row.append()
h5file.root.test.flush()
print('1000 records added')
except:
pass
h5file.close()
Every 10 seconds, it writes data to an HDF5 file. Let's say that I have a computer in a lab that's gathering data from a sensor overnight, and I'd like to analyze that data from my home 5 miles away. It turns out that if this is in a folder that is watched by Dropbox, Dropbox only syncs once the script completes (say, if I give it a Keyboard interrupt). I've found that I can get Dropbox to sync if I run touch does_it_update_dropbox.h5
on a Unix machine. However, my machine at my lab is a Windows.
Stack Overflow, how can I get an HDF5 file to sync over Dropbox as it's being written inside of a Windows computer?