mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:17:35 +00:00
Implement sys$chdir() and teach sh+ls to cd around and browse different dirs.
This commit is contained in:
parent
ac738b03d6
commit
2749e7f1c2
16 changed files with 147 additions and 33 deletions
|
@ -4,14 +4,14 @@
|
|||
|
||||
int main(int c, char** v)
|
||||
{
|
||||
DIR* dirp = opendir("/");
|
||||
DIR* dirp = opendir(".");
|
||||
if (!dirp) {
|
||||
printf("opendir failed :(\n");
|
||||
return 1;
|
||||
}
|
||||
char pathbuf[256];
|
||||
while (auto* de = readdir(dirp)) {
|
||||
sprintf(pathbuf, "/%s", de->d_name);
|
||||
sprintf(pathbuf, "%s", de->d_name);
|
||||
stat st;
|
||||
int rc = lstat(pathbuf, &st);
|
||||
if (rc == -1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue