File descriptor exhaustion when calling FilesystemWriter::write
#614
Unanswered
Lynnesbian
asked this question in
Q&A
Replies: 1 comment
-
I think what I would do to solve this would be to pre-read files that aren't that large, as otherwise the if len < 1024 {
let mut buffer = Vec::new();
file.read_to_end(&mut buffer)?;
let reader = BufReader::new(Cursor::new(buffer));
squash_fs.push_file(reader, entry.path().file_name().unwrap(), header)?
} else {
let reader = BufReader::new(file);
squash_fs.push_file(reader, entry.path().file_name().unwrap(), header)?
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When creating a
FilesystemWriter
, callingpush_file
with many (over a thousand) files, then callingwrite
, the process will crash due to running out of file descriptors.I've created a small reproducer below - it depends on
backhand
andanyhow
, and you'll need to replace thepath
with something that points to a folder with many files on your system.Is there a way around this, beside writing and re-opening the SquashFS filesystem after every few hundred calls to
push_file
?Beta Was this translation helpful? Give feedback.
All reactions