Продолжаю работу над БД. Начальная реализация удаления пакетов.
This commit is contained in:
parent
c292a7f516
commit
b9fe58a482
3 changed files with 68 additions and 4 deletions
8
mcfs.py
8
mcfs.py
|
@ -129,3 +129,11 @@ def check_file_hash(path, ref_hash):
|
|||
data = f.read(buffer_size)
|
||||
hash.update(data)
|
||||
return hash.hexdigest() == ref_hash
|
||||
|
||||
|
||||
def remove(mc_dir_rel_path):
|
||||
path = os.path.join(mc_dir, mc_dir_rel_path)
|
||||
if is_path_exist(path):
|
||||
os.remove(path)
|
||||
else:
|
||||
raise FileNotFoundError
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue