| | @@ -40,6 +40,15 @@ impl Scratch { |
| 40 | 40 | fn path(&self, name: &str) -> NativePath { |
| 41 | 41 | NativePath::from_path(&self.0.join(name)) |
| 42 | 42 | } |
| 43 | +추가: fn worker(&self) -> Command { |
| 44 | +추가: let mut command = Command::new(env!("CARGO_BIN_EXE_zipelo-archive-worker")); |
| 45 | +추가: // 공유 임시 폴더의 할당량과 다른 시험의 사용량에 의존하지 않음. |
| 46 | +추가: command |
| 47 | +추가: .env("TMPDIR", &self.0) |
| 48 | +추가: .env("TMP", &self.0) |
| 49 | +추가: .env("TEMP", &self.0); |
| 50 | +추가: command |
| 51 | +추가: } |
| 43 | 52 | } |
| 44 | 53 | impl Drop for Scratch { |
| 45 | 54 | fn drop(&mut self) { |
| | @@ -51,7 +60,8 @@ fn execute(start: Start) -> Vec<Message> { |
| 51 | 60 | Writer::new(&mut data, 17) |
| 52 | 61 | .send(&Message::Start(start)) |
| 53 | 62 | .unwrap(); |
| 54 | | -삭제: let mut command = Command::new(env!("CARGO_BIN_EXE_zipelo-archive-worker")); |
| 63 | +추가: let temporary = Scratch::new(); |
| 64 | +추가: let mut command = temporary.worker(); |
| 55 | 65 | command |
| 56 | 66 | .stdin(Stdio::piped()) |
| 57 | 67 | .stdout(Stdio::piped()) |
| | @@ -810,7 +820,9 @@ fn interactive( |
| 810 | 820 | mut respond: impl FnMut(u64, u32, PasswordPurpose) -> Vec<Message>, |
| 811 | 821 | ) -> Vec<Message> { |
| 812 | 822 | use std::{io::Read, sync::mpsc, time::Duration}; |
| 813 | | -삭제: let mut child = Command::new(env!("CARGO_BIN_EXE_zipelo-archive-worker")) |
| 823 | +추가: let temporary = Scratch::new(); |
| 824 | +추가: let mut child = temporary |
| 825 | +추가: .worker() |
| 814 | 826 | .stdin(Stdio::piped()) |
| 815 | 827 | .stdout(Stdio::piped()) |
| 816 | 828 | .stderr(Stdio::piped()) |