fix(tlc): repair redox scheme VFS backend compilation

- Add redox_syscall path dependency for the Redox-only scheme backend.
- Fix RedoxStat import to use redox_syscall::data::Stat.
- Match Entry API: Entry { name, stat } and is_dir() method.
- Match Stat API: nlinks/inode fields, Permissions::from_mode.
This commit is contained in:
2026-07-08 20:11:43 +03:00
parent 9c0611e169
commit 970e47d30c
2 changed files with 10 additions and 17 deletions
+2
View File
@@ -76,6 +76,8 @@ suppaftp = { version = "6", optional = true }
tar = { version = "0.4", optional = true }
zip = { version = "2", default-features = false, optional = true }
redox_syscall = { path = "../../../../local/sources/syscall" }
# Syntax highlighting
syntect = { version = "5", default-features = false, features = ["default-onig", "regex-onig"], optional = true }
@@ -23,7 +23,7 @@ use std::io::{self, Read};
use std::path::PathBuf;
use redox_syscall::flag::{O_RDONLY, O_DIRECTORY, O_STAT};
use redox_syscall::{self, Stat as RedoxStat};
use redox_syscall::data::Stat as RedoxStat;
use crate::fs::{FileType, Permissions, Stat};
use crate::vfs::local::Entry;
@@ -70,20 +70,15 @@ impl RedoxSchemeVfs {
};
Stat {
file_type,
permissions: Permissions {
mode: (rs.st_mode & 0o7777) as u16,
},
size: rs.st_size as u64,
permissions: Permissions::from_mode((rs.st_mode & 0o7777) as u32),
size: rs.st_size,
mtime: rs.st_mtime as i64,
atime: rs.st_atime as i64,
ctime: rs.st_ctime as i64,
uid: rs.st_uid,
gid: rs.st_gid,
nlink: rs.st_nlink as u64,
dev: rs.st_dev as u64,
ino: rs.st_ino,
blksize: rs.st_blksize as u64,
blocks: rs.st_blocks as u64,
nlinks: rs.st_nlink as u64,
inode: rs.st_ino,
}
}
}
@@ -131,18 +126,14 @@ impl Vfs for RedoxSchemeVfs {
};
entries.push(Entry {
name,
size: stat.size,
modified: stat.mtime,
is_dir: stat.file_type == FileType::Directory,
is_symlink: stat.file_type == FileType::Symlink,
permissions: stat.permissions,
stat,
});
}
}
let _ = redox_syscall::close(fd);
entries.sort_by(|a, b| {
b.is_dir
.cmp(&a.is_dir)
b.is_dir()
.cmp(&a.is_dir())
.then_with(|| a.name.to_lowercase().cmp(&b.name.to_lowercase()))
});
Ok(entries)