mirror of
https://github.com/LCPQ/QUESTDB_website.git
synced 2024-08-25 05:31:51 +02:00
fileName check in toFile method
This commit is contained in:
parent
d46e0af490
commit
56b4ff0435
@ -219,6 +219,8 @@ class dataFileBase(object):
|
|||||||
if suffix:
|
if suffix:
|
||||||
fileNameComp.append(suffix)
|
fileNameComp.append(suffix)
|
||||||
fileName="_".join(fileNameComp).replace(" ","_")+".dat"
|
fileName="_".join(fileNameComp).replace(" ","_")+".dat"
|
||||||
|
if os.sep in fileName:
|
||||||
|
raise ValueError(f"fileName must be a pure file name not a path: {fileName}")
|
||||||
file=subpath/fileName
|
file=subpath/fileName
|
||||||
if not file.exists():
|
if not file.exists():
|
||||||
with file.open("w") as f:
|
with file.open("w") as f:
|
||||||
|
Loading…
Reference in New Issue
Block a user