do not overwrite existing file(s)
This commit is contained in:
parent
0d57449004
commit
753cdc5ce3
1 changed files with 8 additions and 7 deletions
|
@ -51,6 +51,7 @@ for x in myresult:
|
||||||
except OSError:
|
except OSError:
|
||||||
print ("Creation of the directory %s failed" % path)
|
print ("Creation of the directory %s failed" % path)
|
||||||
|
|
||||||
|
if not os.path.isfile('%s/%s.gmi' % (path,quote(filename))):
|
||||||
print("creating %s/%s.gmi" % (path,quote(filename)))
|
print("creating %s/%s.gmi" % (path,quote(filename)))
|
||||||
f = open("%s/%s.gmi" % (path,quote(filename)), "w")
|
f = open("%s/%s.gmi" % (path,quote(filename)), "w")
|
||||||
f.write("# %s\n\n" % x[1])
|
f.write("# %s\n\n" % x[1])
|
||||||
|
|
Loading…
Reference in a new issue