Open
Description
The *os.File
returned by getOutputFile()
never seems to get closed in mergeFile()
. Is this a bug, or I'm using this the wrong way?
(Windows平台)用了ParallelDownload
后立马os.Rename()
文件会失败,提示文件正在被使用,我把parallel_download.go
单独拿出来改,在mergeFile()
里加上等同于defer file.Close()
的代码,就可以正确使用了。
虽然os/file_windows.go
的newFile()
里,存在runtime.SetFinalizer(f.file, (*file).close)
,但还是建议可控环境下主动调用os.File.Close()
Metadata
Metadata
Assignees
Labels
No labels