fix: show permissions as drwxr-x/755 instead of drwxr-x755 for clarity

This commit is contained in:
2026-07-06 10:31:57 -04:00
parent a88f92e786
commit 0a4004a9ab
+3 -3
View File
@@ -23,9 +23,9 @@ function FileIcon({ name }: { name: string }) {
function modeStr(mode: number): string { function modeStr(mode: number): string {
const perm = (mode & 0o777).toString(8).padStart(3, "0"); const perm = (mode & 0o777).toString(8).padStart(3, "0");
const type = mode & 0o170000; const type = mode & 0o170000;
if (type === 0o40000) return `drwxr-xr-x`.slice(0, 10 - perm.length) + perm; if (type === 0o40000) return `drwxr-xr-x/${perm}`;
if (type === 0o120000) return `lrwxr-xr-x`.slice(0, 10 - perm.length) + perm; if (type === 0o120000) return `lrwxr-xr-x/${perm}`;
return `-rwxr-xr-x`.slice(0, 10 - perm.length) + perm; return `-rwxr-xr-x/${perm}`;
} }
export default function Files() { export default function Files() {