Show More
@@ -9,14 +9,18 b' import os' | |||||
9 | import stat |
|
9 | import stat | |
10 | import sys |
|
10 | import sys | |
11 |
|
11 | |||
12 | text = sys.argv[1] |
|
12 | if sys.version_info[0] >= 3: | |
13 | fname = sys.argv[2] |
|
13 | text = os.fsencode(sys.argv[1]) | |
|
14 | fname = os.fsencode(sys.argv[2]) | |||
|
15 | else: | |||
|
16 | text = sys.argv[1] | |||
|
17 | fname = sys.argv[2] | |||
14 |
|
18 | |||
15 | f = open(fname, "ab") |
|
19 | f = open(fname, "ab") | |
16 | try: |
|
20 | try: | |
17 | before = os.fstat(f.fileno())[stat.ST_MTIME] |
|
21 | before = os.fstat(f.fileno())[stat.ST_MTIME] | |
18 | f.write(text) |
|
22 | f.write(text) | |
19 | f.write("\n") |
|
23 | f.write(b"\n") | |
20 | finally: |
|
24 | finally: | |
21 | f.close() |
|
25 | f.close() | |
22 | inc = 1 |
|
26 | inc = 1 |
General Comments 0
You need to be logged in to leave comments.
Login now