create and delete files
This commit is contained in:
13
src/backend/delete_temp_contents.py
Normal file
13
src/backend/delete_temp_contents.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import os
|
||||
from omegaconf import OmegaConf
|
||||
config = OmegaConf.load("config.yaml")
|
||||
|
||||
def delete_temp_contents():
|
||||
"""
|
||||
delete_temp_contents deletes the contents of the temp directory.
|
||||
"""
|
||||
for root, dirs, files in os.walk(config.database.tempdir):
|
||||
for file in files:
|
||||
os.remove(os.path.join(root, file))
|
||||
for dir in dirs:
|
||||
os.rmdir(os.path.join(root, dir))
|
||||
Reference in New Issue
Block a user