void FileCommands::mkfile(FileSystemUser* fileSystem, string file) { FileObject* fo = fileSystem->getFileObject(); if(fo->containsObject(file)) { duplicateNames(file); return; } file += fileDelim; file += openDelim; file += closeDelim; fo->setEndPos(); string sys = fileSystem->getSystem(); sys.insert(fo->getPos(), file); fileSystem->setNewSystem(sys); fo->addObj(file); }
void FileCommands::mkdir(FileSystemUser* fileSystem, string dir) { FileObject* fo = fileSystem->getFileObject(); if(fo->containsObject(dir)) { duplicateNames(dir); return; } dir += "{"; dir += "}"; fo->setEndPos(); string sys = fileSystem->getSystem(); sys.insert(fo->getPos(), dir); fileSystem->setNewSystem(sys); fo->addObj(dir); }