fix: show permissions as drwxr-x/755 instead of drwxr-x755 for clarity
This commit is contained in:
@@ -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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user