Fix driver implementation

This commit is contained in:
EnderIce2
2024-07-07 03:14:54 +03:00
parent 3e5177d375
commit 51ea074b60
29 changed files with 3069 additions and 1510 deletions

View File

@ -28,24 +28,19 @@ void cmd_cd(const char *args)
if (args[0] == '\0')
return;
/* FIXME: Reimplement this later */
assert(!"Function not implemented");
// Node *thisNode = fs->GetByPath(args, thisProcess->CWD, true);
FileNode *node = fs->GetByPath(args, nullptr);
// if (thisNode == nullptr)
// {
// printf("cd: %s: No such file or directory\n", args);
// return;
// }
if (node == nullptr)
{
printf("cd: %s: No such file or directory\n", args);
return;
}
// if (thisNode->Stat.IsType(SYMLINK))
// thisNode = fs->GetByPath(thisNode->GetSymLink(), nullptr, true);
if (!node->IsDirectory())
{
printf("cd: %s: Not a directory\n", args);
return;
}
// if (!thisNode->Stat.IsType(DIRECTORY))
// {
// printf("cd: %s: Not a directory\n", args);
// return;
// }
// thisProcess->CWD = thisNode;
thisProcess->CWD = node;
}