-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlevel1_basic.py
More file actions
25 lines (22 loc) · 767 Bytes
/
level1_basic.py
File metadata and controls
25 lines (22 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
class FileServer:
def __init__(self):
# TODO: initialize your data structure here
pass
def FILE_UPLOAD(self, file_name: str, size: int):
"""
Upload a file to the server.
- Raise RuntimeError if a file with the same name already exists.
"""
# TODO: implement upload logic
def FILE_GET(self, file_name: str):
"""
Return the file size if it exists, or None if it does not.
"""
# TODO: implement get logic
def FILE_COPY(self, source: str, dest: str):
"""
Copy the source file to dest.
- Raise RuntimeError if the source file doesn't exist.
- Overwrite dest if it already exists.
"""
# TODO: implement copy logic