1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:57:44 +00:00

Add some basic field width support to printf().

Use it to make "ls" output a bit better. Also sys$spawn now fails with EACCES
if the path is not a file that's executable by the current uid/gid.
This commit is contained in:
Andreas Kling 2018-10-27 16:43:03 +02:00
parent de2fb183cc
commit 8f91a47aeb
8 changed files with 212 additions and 272 deletions

View file

@ -22,6 +22,8 @@ int main(int c, char** v)
return 2;
}
printf("%08u ", de->d_ino);
if (S_ISDIR(st.st_mode))
printf("d");
else if (S_ISLNK(st.st_mode))
@ -53,8 +55,9 @@ int main(int c, char** v)
else
printf("%c", st.st_mode & S_IXOTH ? 'x' : '-');
printf(" i:%x ", de->d_ino);
printf(" %x ", st.st_size);
printf(" %4u %4u", st.st_uid, st.st_gid);
printf(" %10u ", st.st_size);
printf("%s%c", de->d_name, S_ISDIR(st.st_mode) ? '/' : ' ');
printf("\n");
}