File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 2
2
import time
3
3
import sys
4
4
import subprocess
5
+ import os
5
6
6
7
start = str (time .time ())
7
8
fpath = "/home/logbox/serial/"
55
56
56
57
if (data .startswith ("C1" )):
57
58
c1 = data .split ("\t " , 1 )[1 ]
58
- c1file = open ("/home/logbox/c1" , "w" )
59
+ c1file = open ("/home/logbox/c1" , "w" , 1 )
59
60
c1file .write (c1 )
61
+ c1file .flush ()
62
+ os .fsync (c1file )
60
63
c1file .close ()
61
64
if (data .startswith ("C2" )):
62
65
c2 = data .split ("\t " , 1 )[1 ]
63
- c2file = open ("/home/logbox/c2" , "w" )
66
+ c2file = open ("/home/logbox/c2" , "w" , 1 )
64
67
c2file .write (c2 )
68
+ c2file .flush ()
69
+ os .fsync (c2file )
65
70
c2file .close ()
66
71
if (data .startswith ("C3" )):
67
72
c3 = data .split ("\t " , 1 )[1 ]
68
- c3file = open ("/home/logbox/c3" , "w" )
73
+ c3file = open ("/home/logbox/c3" , "w" , 1 )
69
74
c3file .write (c3 )
75
+ c3file .flush ()
76
+ os .fsync (c3file )
70
77
c3file .close ()
71
78
72
79
sys .stdout .write (data )
You can’t perform that action at this time.
0 commit comments