This commit is contained in:
2025-05-04 08:19:47 +03:00
parent d8a59d0726
commit 46e1c6706c
177 changed files with 5708 additions and 5512 deletions

View File

@@ -286,17 +286,17 @@ pub fn (myvfs LocalVFS) file_concatenate(path string, data []u8) ! {
if os.is_dir(abs_path) {
return error('Cannot concatenate to directory: ${path}')
}
// Read existing content
existing_content := os.read_bytes(abs_path) or {
return error('Failed to read file ${path}: ${err}')
}
// Create a new buffer with the combined content
mut new_content := []u8{cap: existing_content.len + data.len}
new_content << existing_content
new_content << data
// Write back to file
os.write_file(abs_path, new_content.bytestr()) or {
return error('Failed to write concatenated data to file ${path}: ${err}')
@@ -314,13 +314,13 @@ pub fn (myvfs LocalVFS) get_path(entry &vfs.FSEntry) !string {
pub fn (myvfs LocalVFS) print() ! {
println('LocalVFS:')
println(' Root path: ${myvfs.root_path}')
// Print root directory contents
root_entries := myvfs.dir_list('') or {
println(' Error listing root directory: ${err}')
return
}
println(' Root entries: ${root_entries.len}')
for entry in root_entries {
metadata := entry.get_metadata()