Level 1 Files and copies
Build CloudStorage, a store of files keyed by path (like "/docs/a.txt"). Paths are plain string keys: there are no directory objects, and a path is a file only if it was added.
add_file(name, size) -> bool: add a file.Falseif a file already exists at that path.copy_file(name_from, name_to) -> bool: create a copy of a file at a new path with the same size.False(changing nothing) if the source doesn't exist or something already exists at the destination.get_file_size(name) -> int | None:Noneif there's no such file.delete_file(name) -> int | None: remove the file and return its size, orNoneif there's no such file.
s = CloudStorage()
s.add_file("/a/x.txt", 10) # True
s.copy_file("/a/x.txt", "/b/x.txt") # True
s.copy_file("/a/x.txt", "/b/x.txt") # False: destination exists
s.get_file_size("/b/x.txt") # 10
s.delete_file("/a/x.txt") # 10
s.get_file_size("/a/x.txt") # None