Exemplo n.º 1
0
    def mkdir(self, path, mode):
        print("mkdir requested on path" + path)
        try:
            pathsplit = path.split("/")
            folder = pathsplit[-2]
            filename = pathsplit[-1]
            node = Node.createDirectoryFile(self, None, filename, mode)
            if (folder == ""):
                self.rootNode.addChildren(node)
            else:
                Node.pathToNodeTranslator(
                    self.rootNode,
                    self.__getParentPath(path)).addChildren(node)
        except Exception as e:
            print(str(e) + "on creation (path" + path + ")")
            raise e

        except Exception as e:
            print(e)
            raise e
Exemplo n.º 2
0
 def __init__(self):
     self.fd = 4  #Just a random number , we dont care about file desciptors because we know for the prototype that only one user will perform calls
     self.rootNode = Node.createDirectoryFile(self, None, "/",
                                              0o755)  #this is the root node