From: Norbert N. <Nor...@gm...> - 2004-09-30 07:32:44
|
On Wednesday 29 September 2004 20:10, Ivan Vilata i Balaguer wrote: > On Wed, Sep 29, 2004 at 01:51:32PM +0200, Francesc Alted wrote: > > A Dimecres 29 Setembre 2004 11:57, vareu escriure: > > [...] > > > > > Maybe there is another way to go? My intention is to have one script > > > that opens an existing hdf5 datafile or creates it from scratch if it > > > does not exist and then starts a lengthy calculation saving the curre= nt > > > state every few minutes. Usually, the script would never finish but r= un > > > indefinitely until interrupted by Ctrl-C (therefore close() is never > > > called) > > > > > > Another script would run interactively in parallel (maybe even on > > > another machine) reading the current state from disk and evaluating t= he > > > data. > > > > I do think so. At least there should be someone in the pytables users > > list that are using pytables for doing similar things. > > [...] > > Anyway, I would suggest enclosing the loop in a =E2=80=9Ctry=E2=80= =9D clause to > try and catch the KeyboardInterrupt exception, or maybe use a > =E2=80=9Cfinally=E2=80=9C clause to close the file in any situation. B= ye! Good idea, thanks! Even though: I would strongly hope that it is not necessary. Does=20 h5file.close() do anything on the file but flush() it and then close the=20 physical file? In other words: is there any danger of file corruption if th= e=20 python program is just shut down cold without a chance to save anything? Li= ke=20 =2D when the file is written via NFS and the computer running the program i= s=20 switched off hard? =2D-=20 _________________________________________Norbert Nemec Altdorfer Str. 9a ... D-93049 Regensburg Tel: 0941 / 2009638 ... Mobile: 0179 / 7475199 eMail: <No...@Ne...> |