diff --git a/rcore-fs-fuse/src/zip.rs b/rcore-fs-fuse/src/zip.rs index 16da115..1be87ee 100644 --- a/rcore-fs-fuse/src/zip.rs +++ b/rcore-fs-fuse/src/zip.rs @@ -4,6 +4,7 @@ use std::io::{Read, Write}; use std::mem::uninitialized; use std::os::unix::ffi::OsStrExt; use std::path::Path; +use std::str; use std::sync::Arc; use rcore_fs::vfs::{FileType, INode}; @@ -67,6 +68,11 @@ pub fn unzip_dir(path: &Path, inode: Arc) -> Result<(), Box> { fs::create_dir(&path)?; unzip_dir(path.as_path(), inode)?; } + FileType::SymLink => { + let mut buf: [u8; BUF_SIZE] = unsafe { uninitialized() }; + let len = inode.read_at(0, buf.as_mut())?; + std::os::unix::fs::symlink(path, str::from_utf8(&buf[..len]).unwrap())?; + } _ => panic!("unsupported file type"), } }