mirror of
https://github.com/VirtualHotBar/NetMount.git
synced 2026-07-01 04:34:20 +08:00
fix: #69 添加 rclone --temp-dir 参数,避免上传文件时临时文件保存到系统默认目录
问题:百度网盘上传文件后会在本地C盘保存一份,导致C盘空间快速减少 原因:rclone 的 --cache-dir 只控制缓存后端目录,不控制上传时的临时文件目录 修复:添加 --temp-dir 参数指向配置的缓存目录,确保临时文件在可控位置
This commit is contained in:
@@ -23,6 +23,13 @@ async function startRclone() {
|
||||
osInfo.osType === 'windows'
|
||||
)
|
||||
|
||||
// 确保缓存和临时目录存在
|
||||
try {
|
||||
await invoke('fs_make_dir', { path: rcloneInfo.localArgs.path.tempDir })
|
||||
} catch {
|
||||
// ignore - rclone will create it if needed
|
||||
}
|
||||
|
||||
//自动分配端口
|
||||
rcloneInfo.endpoint.localhost.port = (await getAvailablePorts(2))[1]!
|
||||
|
||||
@@ -46,6 +53,7 @@ async function startRclone() {
|
||||
'--rc-allow-origin=' + window.location.origin || '*',
|
||||
`--config=${rcloneConfigFile()}`,
|
||||
'--cache-dir=' + rcloneInfo.localArgs.path.tempDir,
|
||||
'--temp-dir=' + rcloneInfo.localArgs.path.tempDir,
|
||||
`--log-file=${logFile}`,
|
||||
'--log-level=INFO',
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user